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