Use context parameter for the parentNode

This commit is contained in:
Benoit Marty 2025-10-30 13:02:20 +01:00 committed by Benoit Marty
parent 566515ca88
commit 05c5f3c914
138 changed files with 450 additions and 375 deletions

View file

@ -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)
}
}

View file

@ -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,

View file

@ -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 {