Use method references, and avoid using navigateUp(): let the parent Node decide how to navigate.
This commit is contained in:
@@ -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,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user