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:
@@ -291,16 +291,11 @@ class ElementCallService: NSObject, ElementCallServiceProtocol, PKPushRegistryDe
|
||||
// it from what we have. If the call is running before subscribing then wait
|
||||
// for it to change to `false` otherwise wait for it to turn `true` before
|
||||
// changing to `false`
|
||||
let isCallOngoing = roomProxy.hasOngoingCall
|
||||
let isCallOngoing = roomProxy.infoPublisher.value.hasRoomCall
|
||||
|
||||
roomProxy
|
||||
.actionsPublisher
|
||||
.compactMap { action -> (Bool, [String])? in
|
||||
switch action {
|
||||
case .roomInfoUpdate:
|
||||
return (roomProxy.hasOngoingCall, roomProxy.activeRoomCallParticipants)
|
||||
}
|
||||
}
|
||||
.infoPublisher
|
||||
.compactMap { ($0.hasRoomCall, $0.activeRoomCallParticipants) }
|
||||
.removeDuplicates { $0 == $1 }
|
||||
.dropFirst(isCallOngoing ? 0 : 1)
|
||||
.sink { [weak self] hasOngoingCall, activeRoomCallParticipants in
|
||||
|
||||
Reference in New Issue
Block a user