Fix navigation issue when entering recovery key after navigating from the banner.

This commit is contained in:
Benoit Marty 2024-11-27 17:11:30 +01:00
parent 6b9eb99fa8
commit da8056dcdb
2 changed files with 14 additions and 4 deletions

View file

@ -111,10 +111,15 @@ class SecureBackupFlowNode @AssistedInject constructor(
NavTarget.EnterRecoveryKey -> {
val callback = object : SecureBackupEnterRecoveryKeyNode.Callback {
override fun onEnterRecoveryKeySuccess() {
if (callbacks.isNotEmpty()) {
callbacks.forEach { it.onDone() }
} else {
backstack.pop()
when (plugins.filterIsInstance<SecureBackupEntryPoint.Params>().first().initialElement) {
SecureBackupEntryPoint.InitialTarget.EnterRecoveryKey -> {
callbacks.forEach { it.onDone() }
}
SecureBackupEntryPoint.InitialTarget.ResetIdentity,
SecureBackupEntryPoint.InitialTarget.Root,
SecureBackupEntryPoint.InitialTarget.SetUpRecovery -> {
backstack.pop()
}
}
}
}