diff --git a/changelog.d/4234.bugfix b/changelog.d/4234.bugfix new file mode 100644 index 0000000000..e7b46a6186 --- /dev/null +++ b/changelog.d/4234.bugfix @@ -0,0 +1 @@ +Fixes the developer sync options being displayed in the home menu when developer mode is disabled \ No newline at end of file diff --git a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt index c8fff5605b..df95bb9b14 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeDetailFragment.kt @@ -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) }