Skip to content

Commit

Permalink
Merge pull request #144 from fmasa/refresh-fix
Browse files Browse the repository at this point in the history
Fix updates in character item detail
  • Loading branch information
fmasa authored Aug 4, 2023
2 parents ac267d0 + a82daaa commit 52cef4b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package cz.frantisekmasa.wfrp_master.common.character
import androidx.compose.material.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.remember
import cafe.adriel.voyager.core.screen.Screen
import com.benasher44.uuid.Uuid
Expand Down Expand Up @@ -38,7 +37,7 @@ abstract class CharacterItemDetailScreen(

val navigation = LocalNavigationTransaction.current
val snackbarHolder = LocalPersistentSnackbarHolder.current
val item = remember { derivedStateOf { items.firstOrNull { it.id == itemId } } }.value
val item = remember(items, itemId) { items.firstOrNull { it.id == itemId } }

if (item == null) {
val message = LocalStrings.current.commonUi.itemDoesNotExist
Expand Down

0 comments on commit 52cef4b

Please sign in to comment.