mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 06:55:41 +00:00
Comparing mutable state was wrong
This commit is contained in:
committed by
Benoit Marty
parent
7c6aa0655b
commit
c39c4260eb
+1
-2
@@ -134,11 +134,10 @@ class ChangeRolesPresenter(
|
|||||||
is ChangeRolesEvent.Save -> {
|
is ChangeRolesEvent.Save -> {
|
||||||
val currentUserIsAdmin = roomInfo.roleOf(room.sessionId) == RoomMember.Role.Admin
|
val currentUserIsAdmin = roomInfo.roleOf(room.sessionId) == RoomMember.Role.Admin
|
||||||
val isModifyingAdmins = role == RoomMember.Role.Admin
|
val isModifyingAdmins = role == RoomMember.Role.Admin
|
||||||
val hasChanges = selectedUsers != usersWithRole
|
|
||||||
val isConfirming = saveState.value.isConfirming()
|
val isConfirming = saveState.value.isConfirming()
|
||||||
val modifyingOwners = role is RoomMember.Role.Owner
|
val modifyingOwners = role is RoomMember.Role.Owner
|
||||||
|
|
||||||
val needsConfirmation = (modifyingOwners || currentUserIsAdmin && isModifyingAdmins) && hasChanges && !isConfirming
|
val needsConfirmation = (modifyingOwners || currentUserIsAdmin && isModifyingAdmins) && hasPendingChanges && !isConfirming
|
||||||
|
|
||||||
when {
|
when {
|
||||||
needsConfirmation -> {
|
needsConfirmation -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user