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 74f63c3697
commit 6d389bad9a
2 changed files with 14 additions and 4 deletions

View file

@ -400,6 +400,11 @@ class LoggedInFlowNode @AssistedInject constructor(
is NavTarget.SecureBackup -> { is NavTarget.SecureBackup -> {
secureBackupEntryPoint.nodeBuilder(this, buildContext) secureBackupEntryPoint.nodeBuilder(this, buildContext)
.params(SecureBackupEntryPoint.Params(initialElement = navTarget.initialElement)) .params(SecureBackupEntryPoint.Params(initialElement = navTarget.initialElement))
.callback(object : SecureBackupEntryPoint.Callback {
override fun onDone() {
backstack.pop()
}
})
.build() .build()
} }
NavTarget.Ftue -> { NavTarget.Ftue -> {

View file

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