mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Set visible ranges on the home screen sliding sync view (#342)
* Set visible ranges on the home screen sliding sync view * Prevent the visible items from being updated while in search mode * Enable diffs on invalidations as they seem to fix duplicated events in the home screen room list * Promoted some diffing logs to info from verbose
This commit is contained in:
@@ -89,7 +89,7 @@ class ClientProxy: ClientProxyProtocol {
|
||||
RequiredState(key: "m.room.encryption", value: "")])
|
||||
.name(name: "HomeScreenView")
|
||||
.syncMode(mode: .selective)
|
||||
.addRange(from: 0, to: 50) // FIXME: Replace this with a dynamic solution
|
||||
.addRange(from: 0, to: 20)
|
||||
.build()
|
||||
|
||||
let slidingSync = try slidingSyncBuilder
|
||||
@@ -98,8 +98,9 @@ class ClientProxy: ClientProxyProtocol {
|
||||
.coldCache(name: "ElementX")
|
||||
.build()
|
||||
|
||||
self.roomSummaryProvider = RoomSummaryProvider(slidingSyncController: slidingSync,
|
||||
slidingSyncView: slidingSyncView,
|
||||
let slidingSyncViewProxy = SlidingSyncViewProxy(clientProxy: self, slidingSync: slidingSync, slidingSyncView: slidingSyncView)
|
||||
|
||||
self.roomSummaryProvider = RoomSummaryProvider(slidingSyncViewProxy: slidingSyncViewProxy,
|
||||
roomMessageFactory: RoomMessageFactory())
|
||||
|
||||
self.slidingSync = slidingSync
|
||||
@@ -162,6 +163,11 @@ class ClientProxy: ClientProxyProtocol {
|
||||
slidingSync?.setObserver(observer: nil)
|
||||
}
|
||||
|
||||
func restartSync() {
|
||||
slidingSyncObserverToken?.cancel()
|
||||
slidingSyncObserverToken = slidingSync?.sync()
|
||||
}
|
||||
|
||||
func roomForIdentifier(_ identifier: String) async -> RoomProxyProtocol? {
|
||||
let (slidingSyncRoom, room) = await Task.dispatch(on: clientQueue) {
|
||||
self.roomTupleForIdentifier(identifier)
|
||||
|
||||
Reference in New Issue
Block a user