mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-23 17:40:37 +03:00
ViewPager: avoid redundant room list action handling
In particular bad where "Open at recent messages" would open the room as many times as room lists are alive in the view pager. Change-Id: I58fb2df012e56ce0b6afb984f48c74b7c3e146db
This commit is contained in:
parent
e78ad54850
commit
e2e068f549
1 changed files with 6 additions and 1 deletions
|
@ -132,7 +132,12 @@ class RoomListFragment @Inject constructor(
|
|||
|
||||
sharedActionViewModel
|
||||
.stream()
|
||||
.onEach { handleQuickActions(it) }
|
||||
.onEach {
|
||||
// We might have multiple RoomListFragments, we only want to handle the action once though
|
||||
if (isResumed || roomListParams.explicitSpaceId == SPACE_ID_FOLLOW_APP) {
|
||||
handleQuickActions(it)
|
||||
}
|
||||
}
|
||||
.launchIn(viewLifecycleOwner.lifecycleScope)
|
||||
|
||||
roomListViewModel.onEach(RoomListViewState::roomMembershipChanges) { ms ->
|
||||
|
|
Loading…
Reference in a new issue