common: add post to remember keys for localSavedState

(cherry picked from commit 876b5d8b8fe6e8bcedd414f346430a7c9ce6f4b4)
This commit is contained in:
Harsh Shandilya 2021-12-25 18:52:47 +05:30
parent 743b2db4ef
commit e93baa84be
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80

View file

@ -48,7 +48,7 @@ fun LobstersCard(
postActions: PostActions, postActions: PostActions,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
) { ) {
var localSavedState by remember(isSaved) { mutableStateOf(isSaved) } var localSavedState by remember(post, isSaved) { mutableStateOf(isSaved) }
Box(modifier = modifier.clickable { postActions.viewPost(post.url, post.commentsUrl) }) { Box(modifier = modifier.clickable { postActions.viewPost(post.url, post.commentsUrl) }) {
Column( Column(
modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp).fillMaxWidth(), modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp).fillMaxWidth(),