mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-12-29 11:02:35 +01:00
only updating the visibility of the menu option the home details fragment adds instead of changing all the parent options
- fixes the debug sync options being forced to visible
This commit is contained in:
parent
4f51dbdcf9
commit
64dce0638f
@ -108,9 +108,9 @@ class HomeDetailFragment @Inject constructor(
|
|||||||
|
|
||||||
override fun onPrepareOptionsMenu(menu: Menu) {
|
override fun onPrepareOptionsMenu(menu: Menu) {
|
||||||
withState(viewModel) { state ->
|
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)
|
super.onPrepareOptionsMenu(menu)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user