mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Prepare for event focus and forward pagination (#2745)
Neither are available yet.
This commit is contained in:
+4
-3
@@ -23,7 +23,7 @@ typealias RoomPollsHistoryScreenViewModelType = StateStoreViewModel<RoomPollsHis
|
||||
|
||||
class RoomPollsHistoryScreenViewModel: RoomPollsHistoryScreenViewModelType, RoomPollsHistoryScreenViewModelProtocol {
|
||||
private enum Constants {
|
||||
static let backPaginationEventLimit: UInt = 250
|
||||
static let backPaginationEventLimit: UInt16 = 250
|
||||
}
|
||||
|
||||
private let pollInteractionHandler: PollInteractionHandlerProtocol
|
||||
@@ -82,11 +82,12 @@ class RoomPollsHistoryScreenViewModel: RoomPollsHistoryScreenViewModelType, Room
|
||||
switch callback {
|
||||
case .updatedTimelineItems:
|
||||
self.updatePollsList(filter: state.bindings.filter)
|
||||
case .canBackPaginate(let canBackPaginate):
|
||||
case .paginationState(let paginationState):
|
||||
let canBackPaginate = paginationState.backward != .timelineStartReached
|
||||
if self.state.canBackPaginate != canBackPaginate {
|
||||
self.state.canBackPaginate = canBackPaginate
|
||||
}
|
||||
case .isBackPaginating:
|
||||
case .isLive:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,7 +125,6 @@ struct RoomPollsHistoryScreen_Previews: PreviewProvider, TestablePreview {
|
||||
let roomTimelineController = MockRoomTimelineController()
|
||||
roomTimelineController.timelineItems = []
|
||||
let roomProxyMockConfiguration = RoomProxyMockConfiguration(name: "Polls")
|
||||
roomProxyMockConfiguration.timeline.timelineStartReached = false
|
||||
let viewModel = RoomPollsHistoryScreenViewModel(pollInteractionHandler: PollInteractionHandlerMock(),
|
||||
roomTimelineController: roomTimelineController,
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
@@ -147,8 +146,7 @@ struct RoomPollsHistoryScreen_Previews: PreviewProvider, TestablePreview {
|
||||
roomTimelineController.timelineItemsTimestamp[item.id] = date
|
||||
}
|
||||
|
||||
let roomProxyMockConfiguration = RoomProxyMockConfiguration(name: "Polls")
|
||||
roomProxyMockConfiguration.timeline.timelineStartReached = true
|
||||
let roomProxyMockConfiguration = RoomProxyMockConfiguration(name: "Polls", timelineStartReached: true)
|
||||
let viewModel = RoomPollsHistoryScreenViewModel(pollInteractionHandler: PollInteractionHandlerMock(),
|
||||
roomTimelineController: roomTimelineController,
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
|
||||
Reference in New Issue
Block a user