Add some tests on RoomFlowNode
This commit is contained in:
parent
3854e879e9
commit
776e9bd221
14 changed files with 240 additions and 31 deletions
|
|
@ -83,6 +83,7 @@ class RoomFlowNode @AssistedInject constructor(
|
|||
Timber.v("OnCreate")
|
||||
plugins<LifecycleCallback>().forEach { it.onFlowCreated(inputs.room) }
|
||||
appNavigationStateService.onNavigateToRoom(id, inputs.room.roomId)
|
||||
fetchRoomMembers()
|
||||
},
|
||||
onDestroy = {
|
||||
Timber.v("OnDestroy")
|
||||
|
|
@ -91,8 +92,6 @@ class RoomFlowNode @AssistedInject constructor(
|
|||
appNavigationStateService.onLeavingRoom(id)
|
||||
}
|
||||
)
|
||||
|
||||
lifecycleScope.fetchRoomMembers()
|
||||
roomMembershipObserver.updates
|
||||
.filter { update -> update.roomId == inputs.room.roomId && !update.isUserInRoom }
|
||||
.onEach {
|
||||
|
|
@ -101,7 +100,7 @@ class RoomFlowNode @AssistedInject constructor(
|
|||
.launchIn(lifecycleScope)
|
||||
}
|
||||
|
||||
private fun CoroutineScope.fetchRoomMembers() = launch {
|
||||
private fun fetchRoomMembers() = lifecycleScope.launch {
|
||||
val room = inputs.room
|
||||
room.fetchMembers()
|
||||
.onFailure {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue