mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Move the invites summary provider configuration the underlying sliding sync list is availablle sooner now
This commit is contained in:
@@ -406,13 +406,15 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
notificationSettings: notificationSettings,
|
notificationSettings: notificationSettings,
|
||||||
backgroundTaskService: backgroundTaskService)
|
backgroundTaskService: backgroundTaskService)
|
||||||
try await roomSummaryProvider?.setRoomList(roomListService.allRooms())
|
try await roomSummaryProvider?.setRoomList(roomListService.allRooms())
|
||||||
|
|
||||||
inviteSummaryProvider = RoomSummaryProvider(roomListService: roomListService,
|
inviteSummaryProvider = RoomSummaryProvider(roomListService: roomListService,
|
||||||
eventStringBuilder: eventStringBuilder,
|
eventStringBuilder: eventStringBuilder,
|
||||||
name: "Invites",
|
name: "Invites",
|
||||||
appSettings: appSettings,
|
appSettings: appSettings,
|
||||||
notificationSettings: notificationSettings,
|
notificationSettings: notificationSettings,
|
||||||
backgroundTaskService: backgroundTaskService)
|
backgroundTaskService: backgroundTaskService)
|
||||||
|
try await inviteSummaryProvider?.setRoomList(roomListService.invites())
|
||||||
|
|
||||||
self.syncService = syncService
|
self.syncService = syncService
|
||||||
self.roomListService = roomListService
|
self.roomListService = roomListService
|
||||||
|
|
||||||
@@ -454,22 +456,6 @@ class ClientProxy: ClientProxyProtocol {
|
|||||||
|
|
||||||
// Hide the sync spinner as soon as we get any update back
|
// Hide the sync spinner as soon as we get any update back
|
||||||
callbacks.send(.receivedSyncUpdate)
|
callbacks.send(.receivedSyncUpdate)
|
||||||
|
|
||||||
// The invites are available only when entering `running`
|
|
||||||
if state == .running {
|
|
||||||
Task {
|
|
||||||
do {
|
|
||||||
guard let roomListService = self.roomListService else {
|
|
||||||
MXLog.error("Room list service is not configured")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// Subscribe to invites later as the underlying SlidingSync list is only added when entering AllRooms
|
|
||||||
try await self.inviteSummaryProvider?.setRoomList(roomListService.invites())
|
|
||||||
} catch {
|
|
||||||
MXLog.error("Failed configuring invites room list with error: \(error)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user