mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Run SwiftFormat.
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ final class RoomPollsHistoryScreenCoordinator: CoordinatorProtocol {
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
|
||||
func toPresentable() -> AnyView {
|
||||
AnyView(RoomPollsHistoryScreen(context: viewModel.context))
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ struct RoomPollsHistoryScreenViewState: BindableState {
|
||||
struct RoomPollsHistoryScreenViewStateBindings {
|
||||
/// Polls list filter
|
||||
var filter: RoomPollsHistoryFilter
|
||||
|
||||
|
||||
/// Information describing the currently displayed alert.
|
||||
var alertInfo: AlertInfo<RoomPollsHistoryScreenErrorType>?
|
||||
}
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@ class RoomPollsHistoryScreenViewModel: RoomPollsHistoryScreenViewModelType, Room
|
||||
var actions: AnyPublisher<RoomPollsHistoryScreenViewModelAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
|
||||
init(pollInteractionHandler: PollInteractionHandlerProtocol,
|
||||
timelineController: TimelineControllerProtocol,
|
||||
userIndicatorController: UserIndicatorControllerProtocol) {
|
||||
@@ -103,7 +103,7 @@ class RoomPollsHistoryScreenViewModel: RoomPollsHistoryScreenViewModelType, Room
|
||||
private func displayError(message: String) {
|
||||
state.bindings.alertInfo = .init(id: .alert, title: message)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Poll Interaction Handler
|
||||
|
||||
private func endPoll(pollStartID: String) {
|
||||
@@ -162,7 +162,7 @@ class RoomPollsHistoryScreenViewModel: RoomPollsHistoryScreenViewModelType, Room
|
||||
guard paginateBackwardsTask == nil else {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
paginateBackwardsTask = Task { [weak self] in
|
||||
guard let self else {
|
||||
return
|
||||
|
||||
@@ -122,7 +122,7 @@ struct RoomPollsHistoryScreen_Previews: PreviewProvider, TestablePreview {
|
||||
timelineController: timelineController,
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}()
|
||||
|
||||
|
||||
static let viewModel: RoomPollsHistoryScreenViewModel = {
|
||||
let timelineController = MockTimelineController()
|
||||
|
||||
@@ -131,25 +131,25 @@ struct RoomPollsHistoryScreen_Previews: PreviewProvider, TestablePreview {
|
||||
PollRoomTimelineItem.mock(poll: .emptyDisclosed, isEditable: true)]
|
||||
|
||||
timelineController.timelineItems = polls
|
||||
|
||||
|
||||
for i in 0..<polls.count {
|
||||
let item = polls[i]
|
||||
let date: Date! = DateComponents(calendar: .current, timeZone: .gmt, year: 2023, month: 12, day: 1 + i, hour: 12).date
|
||||
timelineController.timelineItemsTimestamp[item.id] = date
|
||||
}
|
||||
|
||||
|
||||
let roomProxyMockConfiguration = JoinedRoomProxyMockConfiguration(name: "Polls", timelineStartReached: true)
|
||||
return RoomPollsHistoryScreenViewModel(pollInteractionHandler: PollInteractionHandlerMock(),
|
||||
timelineController: timelineController,
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}()
|
||||
|
||||
|
||||
static var previews: some View {
|
||||
ElementNavigationStack {
|
||||
RoomPollsHistoryScreen(context: viewModelEmpty.context)
|
||||
}
|
||||
.previewDisplayName("No polls")
|
||||
|
||||
|
||||
ElementNavigationStack {
|
||||
RoomPollsHistoryScreen(context: viewModel.context)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user