mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fix visible room sliding sync view ranges changing while inside rooms
This commit is contained in:
committed by
Stefan Ceriu
parent
bd61793798
commit
455a7105ef
@@ -20,10 +20,6 @@ import SwiftUI
|
||||
typealias HomeScreenViewModelType = StateStoreViewModel<HomeScreenViewState, HomeScreenViewAction>
|
||||
|
||||
class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol {
|
||||
enum Constants {
|
||||
static let slidingWindowBoundsPadding = 5
|
||||
}
|
||||
|
||||
private let userSession: UserSessionProtocol
|
||||
private let visibleRoomsSummaryProvider: RoomSummaryProviderProtocol?
|
||||
private let allRoomsSummaryProvider: RoomSummaryProviderProtocol?
|
||||
@@ -277,9 +273,6 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
return
|
||||
}
|
||||
|
||||
let lowerBound = max(0, range.lowerBound - Constants.slidingWindowBoundsPadding)
|
||||
let upperBound = min(Int(visibleRoomsSummaryProvider.countPublisher.value), range.upperBound + Constants.slidingWindowBoundsPadding)
|
||||
|
||||
visibleRoomsSummaryProvider.updateVisibleRange(lowerBound..<upperBound, timelineLimit: timelineLimit)
|
||||
visibleRoomsSummaryProvider.updateVisibleRange(range, timelineLimit: timelineLimit)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user