mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 10:37:05 +05:30
android: skip unnecessary database call
This commit is contained in:
parent
684ec34ec9
commit
4124cdcd1b
2 changed files with 1 additions and 3 deletions
|
@ -186,7 +186,6 @@ fun LobstersApp(
|
||||||
DatabasePosts(
|
DatabasePosts(
|
||||||
items = savedPosts,
|
items = savedPosts,
|
||||||
listState = savedListState,
|
listState = savedListState,
|
||||||
isSaved = viewModel::isPostSaved,
|
|
||||||
postActions = postActions,
|
postActions = postActions,
|
||||||
modifier = Modifier.padding(bottom = paddingValues.calculateBottomPadding()),
|
modifier = Modifier.padding(bottom = paddingValues.calculateBottomPadding()),
|
||||||
)
|
)
|
||||||
|
|
|
@ -17,7 +17,6 @@ import java.time.Month
|
||||||
fun DatabasePosts(
|
fun DatabasePosts(
|
||||||
items: Map<Month, List<SavedPost>>,
|
items: Map<Month, List<SavedPost>>,
|
||||||
listState: LazyListState,
|
listState: LazyListState,
|
||||||
isSaved: suspend (SavedPost) -> Boolean,
|
|
||||||
postActions: PostActions,
|
postActions: PostActions,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
|
@ -30,7 +29,7 @@ fun DatabasePosts(
|
||||||
items(posts) { item ->
|
items(posts) { item ->
|
||||||
ListItem(
|
ListItem(
|
||||||
item = item,
|
item = item,
|
||||||
isSaved = isSaved,
|
isSaved = { true },
|
||||||
postActions = postActions,
|
postActions = postActions,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue