Merge pull request #4236 from vector-im/feature/adm/fixing-home-menu-options

Fixing developer sync options always displaying
This commit is contained in:
Benoit Marty 2021-10-18 18:19:20 +02:00 committed by GitHub
commit 2a47acc68a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

1
changelog.d/4234.bugfix Normal file
View File

@ -0,0 +1 @@
Fixes the developer sync options being displayed in the home menu when developer mode is disabled

View File

@ -108,9 +108,9 @@ class HomeDetailFragment @Inject constructor(
override fun onPrepareOptionsMenu(menu: Menu) {
withState(viewModel) { state ->
menu.iterator().forEach { it.isVisible = state.currentTab is HomeTab.RoomList }
val isRoomList = state.currentTab is HomeTab.RoomList
menu.findItem(R.id.menu_home_mark_all_as_read).isVisible = isRoomList && hasUnreadRooms
}
menu.findItem(R.id.menu_home_mark_all_as_read).isVisible = hasUnreadRooms
super.onPrepareOptionsMenu(menu)
}