mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Update files following swiftformat upgrade
This commit is contained in:
committed by
Stefan Ceriu
parent
fe189fcfed
commit
23062901c0
@@ -25,8 +25,13 @@ struct SpaceRoomCell: View {
|
||||
private let verticalInsets = 12.0
|
||||
private let horizontalInsets = 16.0
|
||||
|
||||
private var isEditModeActive: Bool { editMode?.wrappedValue ?? .inactive != .inactive }
|
||||
private var isHighlighted: Bool { isSelected && !isEditModeActive }
|
||||
private var isEditModeActive: Bool {
|
||||
editMode?.wrappedValue ?? .inactive != .inactive
|
||||
}
|
||||
|
||||
private var isHighlighted: Bool {
|
||||
isSelected && !isEditModeActive
|
||||
}
|
||||
|
||||
private var subtitle: String {
|
||||
if spaceServiceRoom.isSpace {
|
||||
|
||||
@@ -12,7 +12,10 @@ typealias LeaveSpaceViewModelType = StateStoreViewModelV2<LeaveSpaceViewState, L
|
||||
|
||||
class LeaveSpaceViewModel: LeaveSpaceViewModelType {
|
||||
let actionsSubject = PassthroughSubject<LeaveSpaceViewModelAction, Never>()
|
||||
var actions: AnyPublisher<LeaveSpaceViewModelAction, Never> { actionsSubject.eraseToAnyPublisher() }
|
||||
var actions: AnyPublisher<LeaveSpaceViewModelAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
private let userIndicatorController: UserIndicatorControllerProtocol
|
||||
private let mediaProvider: MediaProviderProtocol
|
||||
|
||||
@@ -53,8 +56,13 @@ class LeaveSpaceViewModel: LeaveSpaceViewModelType {
|
||||
}
|
||||
}
|
||||
|
||||
private static var leavingIndicatorID: String { "\(Self.self)-Leaving" }
|
||||
private static var failureIndicatorID: String { "\(Self.self)-Failure" }
|
||||
private static var leavingIndicatorID: String {
|
||||
"\(Self.self)-Leaving"
|
||||
}
|
||||
|
||||
private static var failureIndicatorID: String {
|
||||
"\(Self.self)-Failure"
|
||||
}
|
||||
|
||||
private func showLeavingIndicator() {
|
||||
userIndicatorController.submitIndicator(UserIndicator(id: Self.leavingIndicatorID,
|
||||
@@ -75,5 +83,7 @@ class LeaveSpaceViewModel: LeaveSpaceViewModelType {
|
||||
}
|
||||
|
||||
extension LeaveSpaceViewModel: Identifiable {
|
||||
var id: String { state.leaveHandle.id }
|
||||
var id: String {
|
||||
state.leaveHandle.id
|
||||
}
|
||||
}
|
||||
|
||||
+7
-2
@@ -161,8 +161,13 @@ class SpaceAddRoomsScreenViewModel: SpaceAddRoomsScreenViewModelType, SpaceAddRo
|
||||
|
||||
// MARK: User Indicators
|
||||
|
||||
private var savingIndicatorID: String { "\(Self.self)-Saving" }
|
||||
private var failureIndicatorID: String { "\(Self.self)-Failure" }
|
||||
private var savingIndicatorID: String {
|
||||
"\(Self.self)-Saving"
|
||||
}
|
||||
|
||||
private var failureIndicatorID: String {
|
||||
"\(Self.self)-Failure"
|
||||
}
|
||||
|
||||
private func showSavingIndicator() {
|
||||
userIndicatorController.submitIndicator(UserIndicator(id: savingIndicatorID,
|
||||
|
||||
@@ -270,8 +270,13 @@ class SpaceScreenViewModel: SpaceScreenViewModelType, SpaceScreenViewModelProtoc
|
||||
|
||||
// MARK: - Indicators
|
||||
|
||||
private static var removingIndicatorID: String { "\(Self.self)-Removing" }
|
||||
private static var failureIndicatorID: String { "\(Self.self)-Failure" }
|
||||
private static var removingIndicatorID: String {
|
||||
"\(Self.self)-Removing"
|
||||
}
|
||||
|
||||
private static var failureIndicatorID: String {
|
||||
"\(Self.self)-Failure"
|
||||
}
|
||||
|
||||
private func showRemovingIndicator() {
|
||||
userIndicatorController.submitIndicator(UserIndicator(id: Self.removingIndicatorID,
|
||||
|
||||
@@ -12,7 +12,9 @@ import SwiftUI
|
||||
struct SpaceScreen: View {
|
||||
@Bindable var context: SpaceScreenViewModel.Context
|
||||
|
||||
private var isEditModeActive: Bool { context.viewState.editMode != .inactive }
|
||||
private var isEditModeActive: Bool {
|
||||
context.viewState.editMode != .inactive
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
|
||||
@@ -97,7 +97,9 @@ class SpacesScreenViewModel: SpacesScreenViewModelType, SpacesScreenViewModelPro
|
||||
|
||||
// MARK: - Indicators
|
||||
|
||||
private static var failureIndicatorID: String { "\(Self.self)-Failure" }
|
||||
private static var failureIndicatorID: String {
|
||||
"\(Self.self)-Failure"
|
||||
}
|
||||
|
||||
private func showFailureIndicator() {
|
||||
userIndicatorController.submitIndicator(UserIndicator(id: Self.failureIndicatorID,
|
||||
|
||||
@@ -158,11 +158,9 @@ struct SpacesScreen_Previews: PreviewProvider, TestablePreview {
|
||||
let clientProxy = ClientProxyMock(.init())
|
||||
clientProxy.spaceService = SpaceServiceProxyMock(.init(topLevelSpaces: isEmpty ? [] : .mockJoinedSpaces))
|
||||
|
||||
let viewModel = SpacesScreenViewModel(userSession: UserSessionMock(.init(clientProxy: clientProxy)),
|
||||
selectedSpacePublisher: .init(nil),
|
||||
appSettings: appSettings,
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
|
||||
return viewModel
|
||||
return SpacesScreenViewModel(userSession: UserSessionMock(.init(clientProxy: clientProxy)),
|
||||
selectedSpacePublisher: .init(nil),
|
||||
appSettings: appSettings,
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user