Better code
This commit is contained in:
parent
31d5578063
commit
ca0cd9e97d
|
@ -263,6 +263,9 @@ abstract class VectorBaseFragment : BaseMvRxFragment(), HasScreenInjector {
|
|||
}
|
||||
}
|
||||
|
||||
// This should be provided by the framework
|
||||
protected fun invalidateOptionsMenu() = requireActivity().invalidateOptionsMenu()
|
||||
|
||||
/* ==========================================================================================
|
||||
* Common Dialogs
|
||||
* ========================================================================================== */
|
||||
|
|
|
@ -127,7 +127,7 @@ class AttachmentsPreviewFragment @Inject constructor(
|
|||
}
|
||||
|
||||
override fun invalidate() = withState(viewModel) { state ->
|
||||
requireActivity().invalidateOptionsMenu()
|
||||
invalidateOptionsMenu()
|
||||
if (state.attachments.isEmpty()) {
|
||||
requireActivity().setResult(RESULT_CANCELED)
|
||||
requireActivity().finish()
|
||||
|
|
|
@ -149,7 +149,7 @@ class CreateDirectRoomKnownUsersFragment @Inject constructor(
|
|||
}
|
||||
|
||||
private fun renderSelectedUsers(selectedUsers: Set<User>) {
|
||||
vectorBaseActivity.invalidateOptionsMenu()
|
||||
invalidateOptionsMenu()
|
||||
if (selectedUsers.isNotEmpty() && chipGroup.size == 0) {
|
||||
selectedUsers.forEach { addChipToGroup(it, chipGroup) }
|
||||
}
|
||||
|
|
|
@ -257,7 +257,7 @@ class RoomListFragment @Inject constructor(
|
|||
val newValue = state.hasUnread
|
||||
if (hasUnreadRooms != newValue) {
|
||||
hasUnreadRooms = newValue
|
||||
requireActivity().invalidateOptionsMenu()
|
||||
invalidateOptionsMenu()
|
||||
}
|
||||
}
|
||||
else -> Unit
|
||||
|
|
Loading…
Reference in New Issue