mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
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
|
verifySessionEntryPoint
|
||||||
.nodeBuilder(this, buildContext)
|
.nodeBuilder(this, buildContext)
|
||||||
|
|||||||
+1
@@ -31,5 +31,6 @@ interface VerifySessionEntryPoint : FeatureEntryPoint {
|
|||||||
|
|
||||||
interface Callback : Plugin {
|
interface Callback : Plugin {
|
||||||
fun onEnterRecoveryKey()
|
fun onEnterRecoveryKey()
|
||||||
|
fun onDone()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-2
@@ -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,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user