Improve handling members
This commit is contained in:
parent
5104fc8ac1
commit
a1869a3019
15 changed files with 107 additions and 139 deletions
|
|
@ -41,7 +41,6 @@ import io.element.android.libraries.di.SessionScope
|
|||
import io.element.android.libraries.matrix.api.room.MatrixRoom
|
||||
import io.element.android.libraries.matrix.api.room.RoomMembershipObserver
|
||||
import io.element.android.services.appnavstate.api.AppNavigationStateService
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.flow.filter
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
|
|
@ -102,12 +101,18 @@ class RoomFlowNode @AssistedInject constructor(
|
|||
|
||||
private fun fetchRoomMembers() = lifecycleScope.launch {
|
||||
val room = inputs.room
|
||||
/*
|
||||
room.fetchMembers()
|
||||
.map {
|
||||
room.updateMembers()
|
||||
}
|
||||
.onFailure {
|
||||
Timber.e(it, "Fail to fetch members for room ${room.roomId}")
|
||||
}.onSuccess {
|
||||
Timber.v("Success fetching members for room ${room.roomId}")
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import com.bumble.appyx.core.node.node
|
|||
import com.bumble.appyx.core.plugin.Plugin
|
||||
import com.bumble.appyx.navmodel.backstack.activeElement
|
||||
import com.bumble.appyx.testing.junit4.util.MainDispatcherRule
|
||||
import com.bumble.appyx.testing.unit.common.helper.nodeTestHelper
|
||||
import com.bumble.appyx.testing.unit.common.helper.parentNodeTestHelper
|
||||
import com.google.common.truth.Truth
|
||||
import io.element.android.features.messages.api.MessagesEntryPoint
|
||||
|
|
@ -81,19 +80,6 @@ class RoomFlowNodeTest {
|
|||
roomMembershipObserver = RoomMembershipObserver()
|
||||
)
|
||||
|
||||
@Test
|
||||
fun `given a room flow node when initialized then it fetches room members`() {
|
||||
// GIVEN
|
||||
val room = FakeMatrixRoom()
|
||||
val inputs = RoomFlowNode.Inputs(room)
|
||||
val roomFlowNode = aRoomFlowNode(listOf(inputs))
|
||||
Truth.assertThat(room.areMembersFetched).isFalse()
|
||||
// WHEN
|
||||
roomFlowNode.nodeTestHelper()
|
||||
// THEN
|
||||
Truth.assertThat(room.areMembersFetched).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `given a room flow node when initialized then it loads messages entry point`() {
|
||||
// GIVEN
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue