Use method references, and avoid using navigateUp(): let the parent Node decide how to navigate.
This commit is contained in:
parent
f68087bc79
commit
bd8b234f59
3 changed files with 13 additions and 2 deletions
|
|
@ -338,6 +338,10 @@ class LoggedInFlowNode @AssistedInject constructor(
|
|||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onDone() {
|
||||
backstack.pop()
|
||||
}
|
||||
}
|
||||
verifySessionEntryPoint
|
||||
.nodeBuilder(this, buildContext)
|
||||
|
|
|
|||
|
|
@ -31,5 +31,6 @@ interface VerifySessionEntryPoint : FeatureEntryPoint {
|
|||
|
||||
interface Callback : Plugin {
|
||||
fun onEnterRecoveryKey()
|
||||
fun onDone()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,14 +40,20 @@ class VerifySelfSessionNode @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
private fun onDone() {
|
||||
plugins<VerifySessionEntryPoint.Callback>().forEach {
|
||||
it.onDone()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
override fun View(modifier: Modifier) {
|
||||
val state = presenter.present()
|
||||
VerifySelfSessionView(
|
||||
state = state,
|
||||
modifier = modifier,
|
||||
onEnterRecoveryKey = { onEnterRecoveryKey() },
|
||||
goBack = { navigateUp() }
|
||||
onEnterRecoveryKey = ::onEnterRecoveryKey,
|
||||
goBack = ::onDone,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue