Stop delaying subscriptions until after startup (#3294)

- reverts b43797f4bf
- relies on https://github.com/matrix-org/matrix-rust-sdk/pull/3981
This commit is contained in:
Stefan Ceriu
2024-09-18 13:16:46 +03:00
committed by GitHub
parent 63a0a99dbd
commit 9b6470d1f3
2 changed files with 1 additions and 19 deletions
@@ -11,7 +11,6 @@ import MatrixRustSDK
class RoomSummaryProvider: RoomSummaryProviderProtocol {
private let roomListService: RoomListServiceProtocol
private let roomListServiceStatePublisher: CurrentValuePublisher<RoomListServiceState, Never>
private let eventStringBuilder: RoomEventStringBuilder
private let name: String
private let shouldUpdateVisibleRange: Bool
@@ -57,14 +56,12 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
/// to the room list service through the `applyInput(input: .viewport(ranges` api. Only useful for
/// lists that need to update the visible range on Sliding Sync
init(roomListService: RoomListServiceProtocol,
roomListServiceStatePublisher: CurrentValuePublisher<RoomListServiceState, Never>,
eventStringBuilder: RoomEventStringBuilder,
name: String,
shouldUpdateVisibleRange: Bool = false,
notificationSettings: NotificationSettingsProxyProtocol,
appSettings: AppSettings) {
self.roomListService = roomListService
self.roomListServiceStatePublisher = roomListServiceStatePublisher
serialDispatchQueue = DispatchQueue(label: "io.element.elementx.roomsummaryprovider", qos: .default)
self.eventStringBuilder = eventStringBuilder
self.name = name
@@ -77,16 +74,7 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
.sink { [weak self] in self?.updateRoomsWithDiffs($0) }
.store(in: &cancellables)
roomListServiceStateCancellable = roomListServiceStatePublisher
.receive(on: DispatchQueue.main)
.sink { [weak self] state in
guard let self else { return }
if state == .running {
setupVisibleRangeObservers()
roomListServiceStateCancellable = nil
}
}
setupVisibleRangeObservers()
setupNotificationSettingsSubscription()
}