Merge pull request #399 from vector-im/bugfix/fre/fix_create_room_navigation
Fix navigation broken
This commit is contained in:
+4
-2
@@ -23,6 +23,7 @@ import com.bumble.appyx.core.composable.Children
|
||||
import com.bumble.appyx.core.modality.BuildContext
|
||||
import com.bumble.appyx.core.node.Node
|
||||
import com.bumble.appyx.core.plugin.Plugin
|
||||
import com.bumble.appyx.core.plugin.plugins
|
||||
import com.bumble.appyx.navmodel.backstack.BackStack
|
||||
import com.bumble.appyx.navmodel.backstack.operation.push
|
||||
import dagger.assisted.Assisted
|
||||
@@ -76,10 +77,11 @@ class ConfigureRoomFlowNode @AssistedInject constructor(
|
||||
backstack.push(NavTarget.ConfigureRoom)
|
||||
}
|
||||
}
|
||||
createNode<AddPeopleNode>(context = buildContext, plugins = plugins.plus(callback))
|
||||
createNode<AddPeopleNode>(context = buildContext, plugins = listOf(callback))
|
||||
}
|
||||
NavTarget.ConfigureRoom -> {
|
||||
createNode<ConfigureRoomNode>(context = buildContext, plugins = plugins)
|
||||
val callbacks = plugins<ConfigureRoomNode.Callback>()
|
||||
createNode<ConfigureRoomNode>(context = buildContext, plugins = callbacks)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -39,10 +39,8 @@ class ConfigureRoomNode @AssistedInject constructor(
|
||||
fun onCreateRoomSuccess(roomId: RoomId)
|
||||
}
|
||||
|
||||
private val callback = object : Callback {
|
||||
override fun onCreateRoomSuccess(roomId: RoomId) {
|
||||
plugins<Callback>().forEach { it.onCreateRoomSuccess(roomId) }
|
||||
}
|
||||
private fun onRoomCreated(roomId: RoomId) {
|
||||
plugins<Callback>().forEach { it.onCreateRoomSuccess(roomId) }
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -52,7 +50,7 @@ class ConfigureRoomNode @AssistedInject constructor(
|
||||
state = state,
|
||||
modifier = modifier,
|
||||
onBackPressed = this::navigateUp,
|
||||
onRoomCreated = callback::onCreateRoomSuccess
|
||||
onRoomCreated = this::onRoomCreated
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user