Use context parameter for the parentNode
This commit is contained in:
parent
02dc71c4c3
commit
f174084942
138 changed files with 450 additions and 375 deletions
|
|
@ -334,7 +334,6 @@ class LoggedInFlowNode(
|
|||
}
|
||||
}
|
||||
homeEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = callback,
|
||||
)
|
||||
|
|
@ -391,7 +390,6 @@ class LoggedInFlowNode(
|
|||
}
|
||||
}
|
||||
userProfileEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = UserProfileEntryPoint.Params(userId = navTarget.userId),
|
||||
callback = callback,
|
||||
|
|
@ -421,7 +419,6 @@ class LoggedInFlowNode(
|
|||
}
|
||||
val inputs = PreferencesEntryPoint.Params(navTarget.initialElement)
|
||||
preferencesEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = inputs,
|
||||
callback = callback,
|
||||
|
|
@ -439,14 +436,12 @@ class LoggedInFlowNode(
|
|||
}
|
||||
|
||||
startChatEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = callback,
|
||||
)
|
||||
}
|
||||
is NavTarget.SecureBackup -> {
|
||||
secureBackupEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = SecureBackupEntryPoint.Params(initialElement = navTarget.initialElement),
|
||||
callback = object : SecureBackupEntryPoint.Callback {
|
||||
|
|
@ -457,11 +452,10 @@ class LoggedInFlowNode(
|
|||
)
|
||||
}
|
||||
NavTarget.Ftue -> {
|
||||
ftueEntryPoint.createNode(this, buildContext)
|
||||
ftueEntryPoint.createNode(buildContext)
|
||||
}
|
||||
NavTarget.RoomDirectory -> {
|
||||
roomDirectoryEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = object : RoomDirectoryEntryPoint.Callback {
|
||||
override fun navigateToRoom(roomDescription: RoomDescription) {
|
||||
|
|
@ -478,7 +472,6 @@ class LoggedInFlowNode(
|
|||
}
|
||||
is NavTarget.IncomingShare -> {
|
||||
shareEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = ShareEntryPoint.Params(intent = navTarget.intent),
|
||||
callback = object : ShareEntryPoint.Callback {
|
||||
|
|
@ -493,7 +486,6 @@ class LoggedInFlowNode(
|
|||
}
|
||||
is NavTarget.IncomingVerificationRequest -> {
|
||||
incomingVerificationEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = IncomingVerificationEntryPoint.Params(navTarget.data),
|
||||
callback = object : IncomingVerificationEntryPoint.Callback {
|
||||
|
|
|
|||
|
|
@ -84,7 +84,6 @@ class NotLoggedInFlowNode(
|
|||
}
|
||||
}
|
||||
loginEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = LoginEntryPoint.Params(
|
||||
accountProvider = inputs.loginParams?.accountProvider,
|
||||
|
|
|
|||
|
|
@ -250,7 +250,6 @@ class RootFlowNode(
|
|||
}
|
||||
is NavTarget.SignedOutFlow -> {
|
||||
signedOutEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = SignedOutEntryPoint.Params(
|
||||
sessionId = navTarget.sessionId,
|
||||
|
|
@ -265,7 +264,6 @@ class RootFlowNode(
|
|||
}
|
||||
}
|
||||
bugReportEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = callback,
|
||||
)
|
||||
|
|
@ -294,7 +292,6 @@ class RootFlowNode(
|
|||
}
|
||||
}
|
||||
accountSelectEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = callback,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -181,7 +181,6 @@ class RoomFlowNode(
|
|||
}
|
||||
val params = Params(navTarget.roomAlias)
|
||||
roomAliasResolverEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = params,
|
||||
callback = callback,
|
||||
|
|
@ -195,7 +194,7 @@ class RoomFlowNode(
|
|||
serverNames = navTarget.serverNames,
|
||||
trigger = navTarget.trigger,
|
||||
)
|
||||
joinRoomEntryPoint.createNode(this, buildContext, inputs)
|
||||
joinRoomEntryPoint.createNode(buildContext, inputs)
|
||||
}
|
||||
is NavTarget.JoinedRoom -> {
|
||||
val roomFlowNodeCallback = plugins<JoinedRoomLoadedFlowNode.Callback>()
|
||||
|
|
@ -208,7 +207,6 @@ class RoomFlowNode(
|
|||
is NavTarget.JoinedSpace -> {
|
||||
val spaceCallback = plugins<SpaceEntryPoint.Callback>().single()
|
||||
spaceEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
inputs = SpaceEntryPoint.Inputs(roomId = navTarget.spaceId),
|
||||
callback = spaceCallback,
|
||||
|
|
|
|||
|
|
@ -141,7 +141,6 @@ class JoinedRoomLoadedFlowNode(
|
|||
}
|
||||
}
|
||||
return roomDetailsEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = RoomDetailsEntryPoint.Params(initialTarget),
|
||||
callback = callback,
|
||||
|
|
@ -180,7 +179,6 @@ class JoinedRoomLoadedFlowNode(
|
|||
}
|
||||
}
|
||||
forwardEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = params,
|
||||
callback = callback,
|
||||
|
|
@ -204,7 +202,6 @@ class JoinedRoomLoadedFlowNode(
|
|||
}
|
||||
}
|
||||
return spaceEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
inputs = SpaceEntryPoint.Inputs(roomId = inputs.room.roomId),
|
||||
callback = callback,
|
||||
|
|
@ -240,7 +237,6 @@ class JoinedRoomLoadedFlowNode(
|
|||
MessagesEntryPoint.InitialTarget.Messages(navTarget.focusedEventId)
|
||||
)
|
||||
return messagesEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = params,
|
||||
callback = callback,
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ class JoinedRoomLoadedFlowNodeTest {
|
|||
var parameters: MessagesEntryPoint.Params? = null
|
||||
var callback: MessagesEntryPoint.Callback? = null
|
||||
|
||||
context(parentNode: Node)
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
params: MessagesEntryPoint.Params,
|
||||
callback: MessagesEntryPoint.Callback,
|
||||
|
|
@ -77,8 +77,8 @@ class JoinedRoomLoadedFlowNodeTest {
|
|||
private class FakeRoomDetailsEntryPoint : RoomDetailsEntryPoint {
|
||||
var nodeId: String? = null
|
||||
|
||||
context(parentNode: Node)
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
params: RoomDetailsEntryPoint.Params,
|
||||
callback: RoomDetailsEntryPoint.Callback,
|
||||
|
|
@ -90,8 +90,8 @@ class JoinedRoomLoadedFlowNodeTest {
|
|||
private class FakeSpaceEntryPoint : SpaceEntryPoint {
|
||||
var nodeId: String? = null
|
||||
|
||||
context(parentNode: Node)
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
inputs: SpaceEntryPoint.Inputs,
|
||||
callback: SpaceEntryPoint.Callback,
|
||||
|
|
@ -101,8 +101,8 @@ class JoinedRoomLoadedFlowNodeTest {
|
|||
}
|
||||
|
||||
private class FakeForwardEntryPoint : ForwardEntryPoint {
|
||||
context(parentNode: Node)
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
params: ForwardEntryPoint.Params,
|
||||
callback: ForwardEntryPoint.Callback,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue