mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
Fix performance issues with Spaces on very large accounts #4898
- Listen to `MXSpaceNotificationCounter` to update the notification badge
This commit is contained in:
@@ -53,6 +53,8 @@ final class SpaceListViewModel: SpaceListViewModelType {
|
||||
self.userSessionsService = userSessionsService
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(self.sessionDidSync(notification:)), name: MXSpaceService.didBuildSpaceGraph, object: nil)
|
||||
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(self.counterDidUpdateNotificationCount(notification:)), name: MXSpaceNotificationCounter.didUpdateNotificationCount, object: nil)
|
||||
|
||||
}
|
||||
|
||||
@@ -122,6 +124,10 @@ final class SpaceListViewModel: SpaceListViewModelType {
|
||||
loadData()
|
||||
}
|
||||
|
||||
@objc private func counterDidUpdateNotificationCount(notification: Notification) {
|
||||
loadData()
|
||||
}
|
||||
|
||||
private func loadData() {
|
||||
guard let session = self.userSessionsService.mainUserSession?.matrixSession else {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user