fix(updates): Fix wrong date order (#963)
This commit is contained in:
parent
2d05584fea
commit
89f0e240ad
1 changed files with 9 additions and 6 deletions
|
|
@ -99,12 +99,15 @@ class UpdatesScreenModel(
|
|||
isLoading = false,
|
||||
items = updates.toUpdateItems()
|
||||
// KMK -->
|
||||
.groupBy { it.update.mangaId }
|
||||
.values
|
||||
.flatMap { mangaChapters ->
|
||||
val (unread, read) = mangaChapters.partition { !it.update.read }
|
||||
unread.sortedBy { it.update.dateFetch } +
|
||||
read.sortedByDescending { it.update.dateFetch }
|
||||
.groupBy { it.update.dateFetch.toLocalDate() }
|
||||
.flatMap { (_, mangas) ->
|
||||
mangas.groupBy { it.update.mangaId }
|
||||
.values
|
||||
.flatMap { mangaChapters ->
|
||||
val (unread, read) = mangaChapters.partition { !it.update.read }
|
||||
unread.sortedBy { it.update.dateFetch } +
|
||||
read.sortedByDescending { it.update.dateFetch }
|
||||
}
|
||||
}
|
||||
.toPersistentList(),
|
||||
// KMK <--
|
||||
|
|
|
|||
Loading…
Reference in a new issue