diff --git a/data/notifications/src/main/java/com/twofasapp/data/notifications/NotificationsRepositoryImpl.kt b/data/notifications/src/main/java/com/twofasapp/data/notifications/NotificationsRepositoryImpl.kt index 73f60a8e..d0aa5830 100644 --- a/data/notifications/src/main/java/com/twofasapp/data/notifications/NotificationsRepositoryImpl.kt +++ b/data/notifications/src/main/java/com/twofasapp/data/notifications/NotificationsRepositoryImpl.kt @@ -46,7 +46,7 @@ internal class NotificationsRepositoryImpl( } private fun List.sortedByTime(): List { - return sortedWith(compareBy({ it.isRead }, { it.publishTime.unaryMinus() })) + return sortedByDescending { it.publishTime } } override suspend fun getPeriodicNotificationCounter(): Int { diff --git a/feature/home/src/main/java/com/twofasapp/feature/home/ui/notifications/NotificationsScreen.kt b/feature/home/src/main/java/com/twofasapp/feature/home/ui/notifications/NotificationsScreen.kt index bbbefb43..b4d2ee6f 100644 --- a/feature/home/src/main/java/com/twofasapp/feature/home/ui/notifications/NotificationsScreen.kt +++ b/feature/home/src/main/java/com/twofasapp/feature/home/ui/notifications/NotificationsScreen.kt @@ -98,7 +98,7 @@ private fun ScreenContent( onInternalRouteClick(notification.internalRoute.orEmpty()) } } - .background(if (notification.isRead) TwTheme.color.surface else TwTheme.color.background) + .background(if (notification.isRead) TwTheme.color.background else TwTheme.color.surface) .padding(16.dp) ) HorizontalDivider(color = TwTheme.color.divider)