mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Replace individual RoomProxy properties with a stored RoomInfo. (#3445)
* Store RoomInfo updates in JoinedRoomProxy and read from them directly. * Remove all RoomProxy properties that were reading from the RoomInfo.
This commit is contained in:
+3
-3
@@ -37,8 +37,7 @@ class RoomRolesAndPermissionsScreenViewModel: RoomRolesAndPermissionsScreenViewM
|
||||
updateMembers(roomProxy.membersPublisher.value)
|
||||
|
||||
// Automatically update the room permissions
|
||||
roomProxy.actionsPublisher
|
||||
.filter { $0 == .roomInfoUpdate }
|
||||
roomProxy.infoPublisher
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak self] _ in
|
||||
Task { await self?.updatePermissions() }
|
||||
@@ -93,7 +92,8 @@ class RoomRolesAndPermissionsScreenViewModel: RoomRolesAndPermissionsScreenViewM
|
||||
showSavingIndicator()
|
||||
|
||||
// A task we can await until the room's info gets modified with the new power levels.
|
||||
let infoTask = Task { await roomProxy.actionsPublisher.values.first { $0 == .roomInfoUpdate } }
|
||||
// Note: Ignore the first value as the publisher is backed by a current value subject.
|
||||
let infoTask = Task { await roomProxy.infoPublisher.dropFirst().values.first { _ in true } }
|
||||
|
||||
switch await roomProxy.updatePowerLevelsForUsers([(userID: roomProxy.ownUserID, powerLevel: role.rustPowerLevel)]) {
|
||||
case .success:
|
||||
|
||||
Reference in New Issue
Block a user