mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Make the room power levels optional as they can be missing depending on what state events are requested
This commit is contained in:
committed by
Stefan Ceriu
parent
c7ff6c019d
commit
de723853e3
@@ -63,6 +63,7 @@ class ThreadTimelineScreenViewModel: ThreadTimelineScreenViewModelType, ThreadTi
|
||||
// MARK: - Private
|
||||
|
||||
private func handleRoomInfoUpdate(_ roomInfo: RoomInfoProxyProtocol) {
|
||||
state.canSendMessage = roomInfo.powerLevels.canOwnUser(sendMessage: .roomMessage)
|
||||
guard let powerLevels = roomInfo.powerLevels else { fatalError("Missing room power levels") }
|
||||
state.canSendMessage = powerLevels.canOwnUser(sendMessage: .roomMessage)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user