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
@@ -179,7 +179,7 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
|
||||
private func setupRoomSubscription() {
|
||||
roomProxy.infoPublisher
|
||||
.throttle(for: .milliseconds(200), scheduler: DispatchQueue.main, latest: true)
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak self] roomInfo in
|
||||
self?.updateRoomInfo(roomInfo)
|
||||
}
|
||||
@@ -233,8 +233,6 @@ class RoomDetailsScreenViewModel: RoomDetailsScreenViewModelType, RoomDetailsScr
|
||||
state.canBanUsers = powerLevels.canOwnUserBan()
|
||||
state.canJoinCall = powerLevels.canOwnUserJoinCall()
|
||||
state.canEditRolesOrPermissions = powerLevels.suggestedRole(forUser: roomProxy.ownUserID) == .administrator
|
||||
} else {
|
||||
fatalError("Missing room power levels")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user