Промежуточный результат для 1.0.4 версии
This commit is contained in:
@@ -25,6 +25,7 @@ fun AuthFlow(
|
||||
hasExistingAccount: Boolean,
|
||||
accounts: List<AccountInfo> = emptyList(),
|
||||
accountManager: AccountManager,
|
||||
startInCreateMode: Boolean = false,
|
||||
onAuthComplete: (DecryptedAccount?) -> Unit,
|
||||
onLogout: () -> Unit = {}
|
||||
) {
|
||||
@@ -42,6 +43,7 @@ fun AuthFlow(
|
||||
var currentScreen by remember {
|
||||
mutableStateOf(
|
||||
when {
|
||||
startInCreateMode -> AuthScreen.WELCOME
|
||||
hasExistingAccount -> AuthScreen.UNLOCK
|
||||
else -> AuthScreen.WELCOME
|
||||
}
|
||||
@@ -56,6 +58,13 @@ fun AuthFlow(
|
||||
}
|
||||
var showCreateModal by remember { mutableStateOf(false) }
|
||||
var isImportMode by remember { mutableStateOf(false) }
|
||||
|
||||
// If parent requests create mode while AuthFlow is alive, jump to Welcome/Create path.
|
||||
LaunchedEffect(startInCreateMode) {
|
||||
if (startInCreateMode && currentScreen == AuthScreen.UNLOCK) {
|
||||
currentScreen = AuthScreen.WELCOME
|
||||
}
|
||||
}
|
||||
|
||||
// Handle system back button
|
||||
BackHandler(enabled = currentScreen != AuthScreen.UNLOCK && !(currentScreen == AuthScreen.WELCOME && !hasExistingAccount)) {
|
||||
|
||||
Reference in New Issue
Block a user