Dagger: makes sure to not remove an active component when navigating
This commit is contained in:
parent
e3d939726c
commit
f57a2a694d
4 changed files with 16 additions and 13 deletions
|
|
@ -68,13 +68,13 @@ class MainNode(
|
|||
}
|
||||
|
||||
private val roomFlowNodeCallback = object : RoomFlowNode.LifecycleCallback {
|
||||
override fun onFlowCreated(room: MatrixRoom) {
|
||||
override fun onFlowCreated(owner: String, room: MatrixRoom) {
|
||||
val component = bindings<RoomComponent.ParentBindings>().roomComponentBuilder().room(room).build()
|
||||
mainDaggerComponentOwner.addComponent(room.roomId.value, component)
|
||||
mainDaggerComponentOwner.addComponent(owner, component)
|
||||
}
|
||||
|
||||
override fun onFlowReleased(room: MatrixRoom) {
|
||||
mainDaggerComponentOwner.removeComponent(room.roomId.value)
|
||||
override fun onFlowReleased(owner: String, room: MatrixRoom) {
|
||||
mainDaggerComponentOwner.removeComponent(owner)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue