mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Various sliding sync tweaks (#446)
* Refactor SS configuration and add (unfinished) support for adding views dynamically. * Implement pop and clear support on the room summary provider * Register views against sliding sync * Read invalidated vislbeRoomsSummaryProvider from the allRoomSummaryProvider * Switch SS window range setting from the ScrollViewAdapter to a publisher debounce * Tweak allRoomsView addition: switch from listening the visibleRoomsView's state to when it publishes the first diff update * Cleanup client delegate and sliding sync observers and lifecycle * Bump the RustSDK to 1.0.30-alpha * Reuse startSync within restartSync
This commit is contained in:
@@ -51,7 +51,6 @@ private class SlidingSyncViewObserver: SlidingSyncViewRoomListObserver, SlidingS
|
||||
}
|
||||
|
||||
class SlidingSyncViewProxy {
|
||||
private weak var clientProxy: ClientProxyProtocol?
|
||||
private let slidingSync: SlidingSyncProtocol
|
||||
private let slidingSyncView: SlidingSyncViewProtocol
|
||||
|
||||
@@ -64,6 +63,7 @@ class SlidingSyncViewProxy {
|
||||
let diffPublisher = PassthroughSubject<SlidingSyncViewRoomsListDiff, Never>()
|
||||
let statePublisher = PassthroughSubject<SlidingSyncState, Never>()
|
||||
let countPublisher = PassthroughSubject<UInt, Never>()
|
||||
let visibleRangeUpdatePublisher = PassthroughSubject<Void, Never>()
|
||||
|
||||
deinit {
|
||||
listUpdateObserverToken?.cancel()
|
||||
@@ -71,8 +71,7 @@ class SlidingSyncViewProxy {
|
||||
countUpdateObserverToken?.cancel()
|
||||
}
|
||||
|
||||
init(clientProxy: ClientProxyProtocol, slidingSync: SlidingSyncProtocol, slidingSyncView: SlidingSyncViewProtocol) {
|
||||
self.clientProxy = clientProxy
|
||||
init(slidingSync: SlidingSyncProtocol, slidingSyncView: SlidingSyncViewProtocol) {
|
||||
self.slidingSync = slidingSync
|
||||
self.slidingSyncView = slidingSyncView
|
||||
|
||||
@@ -103,11 +102,11 @@ class SlidingSyncViewProxy {
|
||||
try slidingSync.getRoom(roomId: identifier)
|
||||
}
|
||||
|
||||
func updateVisibleRange(_ range: ClosedRange<Int>) {
|
||||
func updateVisibleRange(_ range: Range<Int>) {
|
||||
MXLog.info("Setting sliding sync view range to \(range)")
|
||||
|
||||
slidingSyncView.setRange(start: UInt32(range.lowerBound), end: UInt32(range.upperBound))
|
||||
|
||||
clientProxy?.restartSync()
|
||||
visibleRangeUpdatePublisher.send(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user