Skip to content

Commit

Permalink
navigateUp when app is respawned without any state in VerifyAppScreen
Browse files Browse the repository at this point in the history
Detected by checking if the hash is empty in a LaunchedEffect in VerifyAppScreen.kt.
  • Loading branch information
soupslurpr committed Jan 1, 2024
1 parent 84c8910 commit d9c9787
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ fun AppVerifierApp(
verifyAppUiState.value.appNotFound.value,
{ verifyAppViewModel.verifyFromText(it) },
verifyAppUiState.value.invalidFormat.value,
{ navController.navigateUp() }
)
}
composable(route = AppVerifierScreens.Settings.name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.material3.MaterialTheme.typography
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
Expand All @@ -50,6 +51,7 @@ fun VerifyAppScreen(
appNotFound: Boolean,
onVerifyFromClipboard: (String) -> Unit,
invalidFormat: Boolean,
onLaunchedEffectHashEmpty: () -> Unit,
) {
val context = LocalContext.current

Expand All @@ -59,6 +61,12 @@ fun VerifyAppScreen(

var showMoreInfoAboutVerificationStatusDialog by rememberSaveable { mutableStateOf(false) }

LaunchedEffect(hash) {
if (hash.isEmpty()) {
onLaunchedEffectHashEmpty()
}
}

Column(
modifier = Modifier
.fillMaxSize()
Expand Down

0 comments on commit d9c9787

Please sign in to comment.