File tree Expand file tree Collapse file tree
app/src/main/java/to/bitkit/ui/settings/pin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,13 +45,10 @@ fun PinManagementScreen(
4545 val app = appViewModel ? : return
4646 val settings = settingsViewModel ? : return
4747 val isPinEnabled by settings.isPinEnabled.collectAsStateWithLifecycle()
48- val currentSheet by app.currentSheet.collectAsStateWithLifecycle()
49- var pinSheetWasShown by remember { mutableStateOf(false ) }
48+ val initialPinState = remember { isPinEnabled }
5049
51- LaunchedEffect (currentSheet) {
52- if (currentSheet is Sheet .Pin || currentSheet is Sheet .ChangePin || currentSheet is Sheet .DisablePin ) {
53- pinSheetWasShown = true
54- } else if (pinSheetWasShown && currentSheet == null ) {
50+ LaunchedEffect (isPinEnabled) {
51+ if (isPinEnabled != initialPinState) {
5552 navController.popBackStack()
5653 }
5754 }
You can’t perform that action at this time.
0 commit comments