fix for members role not updating in the room members list

This commit is contained in:
Mauro Romito
2025-11-06 13:51:08 +01:00
committed by Mauro
parent c898d44178
commit 7fd053146d
@@ -68,7 +68,8 @@ class RoomMembersListScreenViewModel: RoomMembersListScreenViewModelType, RoomMe
hideLoadingIndicator(Self.setupMembersLoadingIndicatorIdentifier)
}
roomProxy.membersPublisher.combineLatest(roomProxy.identityStatusChangesPublisher)
roomProxy.membersPublisher
.combineLatest(roomProxy.identityStatusChangesPublisher)
.filter { !$0.0.isEmpty }
.receive(on: DispatchQueue.main)
.sink { [weak self] members, _ in
@@ -80,6 +81,14 @@ class RoomMembersListScreenViewModel: RoomMembersListScreenViewModelType, RoomMe
Task { await roomProxy.updateMembers() }
}
.store(in: &cancellables)
roomProxy.infoPublisher
.map(\.powerLevels)
.removeDuplicates { $0?.userPowerLevels == $1?.userPowerLevels }
.sink { [weak self] _ in
Task { await self?.roomProxy.updateMembers() }
}
.store(in: &cancellables)
}
private func updateState(members: [RoomMemberProxyProtocol]) {