fix(android): sort saved posts in view model

This commit is contained in:
Harsh Shandilya 2023-09-30 02:03:15 +05:30
parent 61a72b330d
commit 91bf5e5555
No known key found for this signature in database

View file

@ -86,7 +86,10 @@ constructor(
get() = newestPostsPager.flow
val savedPosts
get() = savedPostsRepository.savedPosts
get() =
savedPostsRepository.savedPosts.map {
it.sortedByDescending { post -> post.createdAt.toLocalDateTime() }
}
val savedPostsByMonth
get() = savedPosts.map(::mapSavedPosts)