mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Be more lenient with the power levels as they can still be missing at the time the various screens are created e.g. after accepting an invite.
The correct solution is to subscribe to update and update the UI accordingly when receiving them.
This commit is contained in:
committed by
Stefan Ceriu
parent
37cbf733d4
commit
9c28a69ccf
@@ -103,10 +103,11 @@ class RoomMembersListScreenViewModel: RoomMembersListScreenViewModelType, RoomMe
|
||||
bannedMembers: roomMembersDetails.bannedMembers,
|
||||
bindings: state.bindings)
|
||||
|
||||
guard let powerLevels = roomProxy.infoPublisher.value.powerLevels else { fatalError("Missing room power levels") }
|
||||
self.state.canInviteUsers = powerLevels.canOwnUserInvite()
|
||||
self.state.canKickUsers = powerLevels.canOwnUserKick()
|
||||
self.state.canBanUsers = powerLevels.canOwnUserBan()
|
||||
if let powerLevels = roomProxy.infoPublisher.value.powerLevels {
|
||||
self.state.canInviteUsers = powerLevels.canOwnUserInvite()
|
||||
self.state.canKickUsers = powerLevels.canOwnUserKick()
|
||||
self.state.canBanUsers = powerLevels.canOwnUserBan()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user