android: reverse saved posts sorting order

This commit is contained in:
Harsh Shandilya 2022-05-04 23:05:12 +05:30
parent f3df353109
commit 4e261af246
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -21,7 +21,7 @@ fun DatabasePosts(
postActions: PostActions, postActions: PostActions,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
val sorted = items.sortedBy { post -> post.createdAt.asZonedDateTime() } val sorted = items.sortedByDescending { post -> post.createdAt.asZonedDateTime() }
val grouped = sorted.groupBy { post -> post.createdAt.asZonedDateTime().month } val grouped = sorted.groupBy { post -> post.createdAt.asZonedDateTime().month }
LazyColumn( LazyColumn(
state = listState, state = listState,