Comparing mutable state was wrong
This commit is contained in:
committed by
Benoit Marty
parent
37c5ba4b94
commit
0110cf018a
@@ -134,11 +134,10 @@ class ChangeRolesPresenter(
|
||||
is ChangeRolesEvent.Save -> {
|
||||
val currentUserIsAdmin = roomInfo.roleOf(room.sessionId) == RoomMember.Role.Admin
|
||||
val isModifyingAdmins = role == RoomMember.Role.Admin
|
||||
val hasChanges = selectedUsers != usersWithRole
|
||||
val isConfirming = saveState.value.isConfirming()
|
||||
val modifyingOwners = role is RoomMember.Role.Owner
|
||||
|
||||
val needsConfirmation = (modifyingOwners || currentUserIsAdmin && isModifyingAdmins) && hasChanges && !isConfirming
|
||||
val needsConfirmation = (modifyingOwners || currentUserIsAdmin && isModifyingAdmins) && hasPendingChanges && !isConfirming
|
||||
|
||||
when {
|
||||
needsConfirmation -> {
|
||||
|
||||
Reference in New Issue
Block a user