mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Use context parameter for the parentNode
This commit is contained in:
committed by
Benoit Marty
parent
02dc71c4c3
commit
f174084942
+2
-1
@@ -16,7 +16,8 @@ import io.element.android.libraries.architecture.createNode
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultFtueEntryPoint : FtueEntryPoint {
|
||||
override fun createNode(parentNode: Node, buildContext: BuildContext): Node {
|
||||
context(parentNode: Node)
|
||||
override fun createNode(buildContext: BuildContext): Node {
|
||||
return parentNode.createNode<FtueFlowNode>(buildContext)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -102,7 +102,7 @@ class FtueFlowNode(
|
||||
createNode<NotificationsOptInNode>(buildContext, listOf(callback))
|
||||
}
|
||||
NavTarget.AnalyticsOptIn -> {
|
||||
analyticsEntryPoint.createNode(this, buildContext)
|
||||
analyticsEntryPoint.createNode(buildContext)
|
||||
}
|
||||
NavTarget.LockScreenSetup -> {
|
||||
val callback = object : LockScreenEntryPoint.Callback {
|
||||
@@ -111,7 +111,6 @@ class FtueFlowNode(
|
||||
}
|
||||
}
|
||||
lockScreenEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
navTarget = LockScreenEntryPoint.Target.Setup,
|
||||
callback = callback,
|
||||
|
||||
-3
@@ -104,7 +104,6 @@ class FtueSessionVerificationFlowNode(
|
||||
}
|
||||
is NavTarget.UseAnotherDevice -> {
|
||||
outgoingVerificationEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = OutgoingVerificationEntryPoint.Params(
|
||||
showDeviceVerifiedScreen = true,
|
||||
@@ -128,7 +127,6 @@ class FtueSessionVerificationFlowNode(
|
||||
}
|
||||
is NavTarget.EnterRecoveryKey -> {
|
||||
secureBackupEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = SecureBackupEntryPoint.Params(SecureBackupEntryPoint.InitialTarget.EnterRecoveryKey),
|
||||
callback = secureBackupEntryPointCallback
|
||||
@@ -136,7 +134,6 @@ class FtueSessionVerificationFlowNode(
|
||||
}
|
||||
is NavTarget.ResetIdentity -> {
|
||||
secureBackupEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = SecureBackupEntryPoint.Params(SecureBackupEntryPoint.InitialTarget.ResetIdentity),
|
||||
callback = object : SecureBackupEntryPoint.Callback {
|
||||
|
||||
+5
-3
@@ -35,11 +35,11 @@ class DefaultFtueEntryPointTest {
|
||||
FtueFlowNode(
|
||||
buildContext = buildContext,
|
||||
plugins = plugins,
|
||||
analyticsEntryPoint = { _, _ -> lambdaError() },
|
||||
analyticsEntryPoint = { _ -> lambdaError() },
|
||||
defaultFtueService = createDefaultFtueService(),
|
||||
lockScreenEntryPoint = object : LockScreenEntryPoint {
|
||||
context(parentNode: Node)
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
navTarget: LockScreenEntryPoint.Target,
|
||||
callback: LockScreenEntryPoint.Callback,
|
||||
@@ -51,7 +51,9 @@ class DefaultFtueEntryPointTest {
|
||||
},
|
||||
)
|
||||
}
|
||||
val result = entryPoint.createNode(parentNode, BuildContext.root(null))
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(BuildContext.root(null))
|
||||
}
|
||||
assertThat(result).isInstanceOf(FtueFlowNode::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user