mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
More Moderation tweaks (#2566)
* Show room member role changes in the timeline. * Fix a bug in room flow coordinator. * Tidy up roles and permissions flow. * Refresh the power levels in the room details screen. * Automatically update permissions after saving. * Remove extra button. * Add a short delay to the roles and permissions screen snapshots. The permissions rows are now in a loading state initially.
This commit is contained in:
@@ -122,9 +122,19 @@ class RoomChangeRolesScreenViewModel: RoomChangeRolesScreenViewModelType, RoomCh
|
||||
|
||||
let promotingUpdates = state.membersToPromote.map { ($0.id, state.mode.rustPowerLevel) }
|
||||
let demotingUpdates = state.membersToDemote.map { ($0.id, Int64(0)) }
|
||||
|
||||
// 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 } }
|
||||
|
||||
switch await roomProxy.updatePowerLevelsForUsers(promotingUpdates + demotingUpdates) {
|
||||
case .success:
|
||||
MXLog.info("Success")
|
||||
|
||||
// Call updateMembers so the count is correct on the root screen.
|
||||
_ = await infoTask.value
|
||||
await roomProxy.updateMembers()
|
||||
|
||||
actionsSubject.send(.complete)
|
||||
case .failure:
|
||||
context.alertInfo = AlertInfo(id: .error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user