mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Remove context(parentNode: Node) and provide the parent Node as a parameter.
This commit is contained in:
+5
-2
@@ -16,8 +16,11 @@ import io.element.android.libraries.architecture.createNode
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultJoinRoomEntryPoint : JoinRoomEntryPoint {
|
||||
context(parentNode: Node)
|
||||
override fun createNode(buildContext: BuildContext, inputs: JoinRoomEntryPoint.Inputs): Node {
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
inputs: JoinRoomEntryPoint.Inputs,
|
||||
): Node {
|
||||
return parentNode.createNode<JoinRoomFlowNode>(
|
||||
buildContext = buildContext,
|
||||
plugins = listOf(inputs)
|
||||
|
||||
+5
-1
@@ -64,7 +64,11 @@ class JoinRoomFlowNode(
|
||||
|
||||
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
|
||||
return when (navTarget) {
|
||||
is NavTarget.DeclineInviteAndBlockUser -> declineAndBlockEntryPoint.createNode(buildContext, navTarget.inviteData)
|
||||
is NavTarget.DeclineInviteAndBlockUser -> declineAndBlockEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
inviteData = navTarget.inviteData,
|
||||
)
|
||||
NavTarget.Root -> rootNode(buildContext)
|
||||
}
|
||||
}
|
||||
|
||||
+5
-3
@@ -48,9 +48,11 @@ class DefaultJoinRoomEntryPointTest {
|
||||
serverNames = emptyList(),
|
||||
trigger = JoinedRoom.Trigger.RoomDirectory,
|
||||
)
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(BuildContext.root(null), inputs)
|
||||
}
|
||||
val result = entryPoint.createNode(
|
||||
parentNode = parentNode,
|
||||
buildContext = BuildContext.root(null),
|
||||
inputs = inputs,
|
||||
)
|
||||
assertThat(result).isInstanceOf(JoinRoomFlowNode::class.java)
|
||||
assertThat(result.plugins).contains(inputs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user