Remove context(parentNode: Node) and provide the parent Node as a parameter.
This commit is contained in:
parent
f1822c5afd
commit
07b6148035
161 changed files with 668 additions and 436 deletions
|
|
@ -334,6 +334,7 @@ class LoggedInFlowNode(
|
|||
}
|
||||
}
|
||||
homeEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = callback,
|
||||
)
|
||||
|
|
@ -390,6 +391,7 @@ class LoggedInFlowNode(
|
|||
}
|
||||
}
|
||||
userProfileEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = UserProfileEntryPoint.Params(userId = navTarget.userId),
|
||||
callback = callback,
|
||||
|
|
@ -419,6 +421,7 @@ class LoggedInFlowNode(
|
|||
}
|
||||
val inputs = PreferencesEntryPoint.Params(navTarget.initialElement)
|
||||
preferencesEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = inputs,
|
||||
callback = callback,
|
||||
|
|
@ -436,12 +439,14 @@ 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 {
|
||||
|
|
@ -452,10 +457,11 @@ class LoggedInFlowNode(
|
|||
)
|
||||
}
|
||||
NavTarget.Ftue -> {
|
||||
ftueEntryPoint.createNode(buildContext)
|
||||
ftueEntryPoint.createNode(this, buildContext)
|
||||
}
|
||||
NavTarget.RoomDirectory -> {
|
||||
roomDirectoryEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = object : RoomDirectoryEntryPoint.Callback {
|
||||
override fun navigateToRoom(roomDescription: RoomDescription) {
|
||||
|
|
@ -472,6 +478,7 @@ class LoggedInFlowNode(
|
|||
}
|
||||
is NavTarget.IncomingShare -> {
|
||||
shareEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = ShareEntryPoint.Params(intent = navTarget.intent),
|
||||
callback = object : ShareEntryPoint.Callback {
|
||||
|
|
@ -486,6 +493,7 @@ class LoggedInFlowNode(
|
|||
}
|
||||
is NavTarget.IncomingVerificationRequest -> {
|
||||
incomingVerificationEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = IncomingVerificationEntryPoint.Params(navTarget.data),
|
||||
callback = object : IncomingVerificationEntryPoint.Callback {
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ class NotLoggedInFlowNode(
|
|||
}
|
||||
}
|
||||
loginEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = LoginEntryPoint.Params(
|
||||
accountProvider = inputs.loginParams?.accountProvider,
|
||||
|
|
|
|||
|
|
@ -250,6 +250,7 @@ class RootFlowNode(
|
|||
}
|
||||
is NavTarget.SignedOutFlow -> {
|
||||
signedOutEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = SignedOutEntryPoint.Params(
|
||||
sessionId = navTarget.sessionId,
|
||||
|
|
@ -264,6 +265,7 @@ class RootFlowNode(
|
|||
}
|
||||
}
|
||||
bugReportEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = callback,
|
||||
)
|
||||
|
|
@ -292,6 +294,7 @@ class RootFlowNode(
|
|||
}
|
||||
}
|
||||
accountSelectEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
callback = callback,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -181,6 +181,7 @@ class RoomFlowNode(
|
|||
}
|
||||
val params = Params(navTarget.roomAlias)
|
||||
roomAliasResolverEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = params,
|
||||
callback = callback,
|
||||
|
|
@ -194,7 +195,11 @@ class RoomFlowNode(
|
|||
serverNames = navTarget.serverNames,
|
||||
trigger = navTarget.trigger,
|
||||
)
|
||||
joinRoomEntryPoint.createNode(buildContext, inputs)
|
||||
joinRoomEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
inputs = inputs,
|
||||
)
|
||||
}
|
||||
is NavTarget.JoinedRoom -> {
|
||||
val roomFlowNodeCallback = plugins<JoinedRoomLoadedFlowNode.Callback>()
|
||||
|
|
@ -207,6 +212,7 @@ 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,6 +141,7 @@ class JoinedRoomLoadedFlowNode(
|
|||
}
|
||||
}
|
||||
return roomDetailsEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = RoomDetailsEntryPoint.Params(initialTarget),
|
||||
callback = callback,
|
||||
|
|
@ -179,6 +180,7 @@ class JoinedRoomLoadedFlowNode(
|
|||
}
|
||||
}
|
||||
forwardEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = params,
|
||||
callback = callback,
|
||||
|
|
@ -202,6 +204,7 @@ class JoinedRoomLoadedFlowNode(
|
|||
}
|
||||
}
|
||||
return spaceEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
inputs = SpaceEntryPoint.Inputs(roomId = inputs.room.roomId),
|
||||
callback = callback,
|
||||
|
|
@ -237,6 +240,7 @@ class JoinedRoomLoadedFlowNode(
|
|||
MessagesEntryPoint.InitialTarget.Messages(navTarget.focusedEventId)
|
||||
)
|
||||
return messagesEntryPoint.createNode(
|
||||
parentNode = this,
|
||||
buildContext = buildContext,
|
||||
params = params,
|
||||
callback = callback,
|
||||
|
|
|
|||
|
|
@ -55,8 +55,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,
|
||||
|
|
@ -78,8 +78,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,
|
||||
|
|
@ -91,8 +91,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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue