mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Remove context(parentNode: Node) and provide the parent Node as a parameter.
This commit is contained in:
+1
-1
@@ -15,8 +15,8 @@ import io.element.android.libraries.architecture.NodeInputs
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
|
||||
interface SpaceEntryPoint : FeatureEntryPoint {
|
||||
context(parentNode: Node)
|
||||
fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
inputs: Inputs,
|
||||
callback: Callback
|
||||
|
||||
+6
-2
@@ -16,8 +16,12 @@ import io.element.android.libraries.di.SessionScope
|
||||
|
||||
@ContributesBinding(SessionScope::class)
|
||||
class DefaultSpaceEntryPoint : SpaceEntryPoint {
|
||||
context(parentNode: Node)
|
||||
override fun createNode(buildContext: BuildContext, inputs: SpaceEntryPoint.Inputs, callback: SpaceEntryPoint.Callback): Node {
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
inputs: SpaceEntryPoint.Inputs,
|
||||
callback: SpaceEntryPoint.Callback,
|
||||
): Node {
|
||||
return parentNode.createNode<SpaceFlowNode>(
|
||||
buildContext = buildContext,
|
||||
plugins = listOf(inputs, callback),
|
||||
|
||||
+6
-7
@@ -48,13 +48,12 @@ class DefaultSpaceEntryPointTest {
|
||||
override fun navigateToRoomDetails() = lambdaError()
|
||||
override fun navigateToRoomMemberList() = lambdaError()
|
||||
}
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(
|
||||
buildContext = BuildContext.root(null),
|
||||
inputs = nodeInputs,
|
||||
callback = callback,
|
||||
)
|
||||
}
|
||||
val result = entryPoint.createNode(
|
||||
parentNode = parentNode,
|
||||
buildContext = BuildContext.root(null),
|
||||
inputs = nodeInputs,
|
||||
callback = callback,
|
||||
)
|
||||
assertThat(result).isInstanceOf(SpaceFlowNode::class.java)
|
||||
assertThat(result.plugins).contains(nodeInputs)
|
||||
assertThat(result.plugins).contains(callback)
|
||||
|
||||
Reference in New Issue
Block a user