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:
@@ -62,7 +62,7 @@ final class CreateRoomScreenCoordinator: CoordinatorProtocol {
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
|
||||
func toPresentable() -> AnyView {
|
||||
AnyView(CreateRoomScreen(context: viewModel.context))
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ struct CreateRoomScreenViewState: BindableState {
|
||||
var canCreateRoom: Bool {
|
||||
!roomName.isEmpty && aliasErrors.isEmpty
|
||||
}
|
||||
|
||||
|
||||
var aliasErrors: Set<CreateRoomScreenAliasErrorState> = []
|
||||
var aliasErrorDescription: String? {
|
||||
if aliasErrors.contains(.alreadyExists) {
|
||||
@@ -62,7 +62,7 @@ struct CreateRoomScreenViewState: BindableState {
|
||||
nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var availableAccessTypes: [CreateRoomScreenAccessType] {
|
||||
var availableAccessTypes: [CreateRoomScreenAccessType] = []
|
||||
if isSpace {
|
||||
|
||||
@@ -58,7 +58,7 @@ class CreateRoomScreenViewModel: CreateRoomScreenViewModelType, CreateRoomScreen
|
||||
let bindings = CreateRoomScreenViewStateBindings(roomTopic: "",
|
||||
selectedAccessType: selectedAccessType,
|
||||
selectedSpace: selectedSpace)
|
||||
|
||||
|
||||
super.init(initialViewState: CreateRoomScreenViewState(isSpace: isSpace,
|
||||
shouldShowCancelButton: shouldShowCancelButton,
|
||||
roomName: "",
|
||||
@@ -137,7 +137,7 @@ class CreateRoomScreenViewModel: CreateRoomScreenViewModelType, CreateRoomScreen
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
|
||||
private func setupBindings() {
|
||||
// Reset the state related to public rooms if the user choses the room to be empty
|
||||
context.$viewState
|
||||
|
||||
@@ -12,7 +12,7 @@ import SwiftUI
|
||||
struct CreateRoomScreen: View {
|
||||
@ObservedObject var context: CreateRoomScreenViewModel.Context
|
||||
@FocusState private var focus: Focus?
|
||||
|
||||
|
||||
private enum Focus {
|
||||
case name
|
||||
case topic
|
||||
@@ -380,7 +380,7 @@ struct CreateRoom_Previews: PreviewProvider, TestablePreview {
|
||||
viewModel.context.selectedAccessType = .askToJoinWithSpaceMembers
|
||||
return viewModel
|
||||
}()
|
||||
|
||||
|
||||
static var previews: some View {
|
||||
ElementNavigationStack {
|
||||
CreateRoomScreen(context: viewModel.context)
|
||||
@@ -455,7 +455,7 @@ struct CreateRoom_Previews: PreviewProvider, TestablePreview {
|
||||
let spaces = [SpaceServiceRoom].mockJoinedSpaces2
|
||||
clientProxy.spaceService = SpaceServiceProxyMock(.init(editableSpaces: spaces))
|
||||
let userSession = UserSessionMock(.init(clientProxy: clientProxy))
|
||||
|
||||
|
||||
return CreateRoomScreenViewModel(isSpace: isSpace,
|
||||
spaceSelectionMode: selectionMode,
|
||||
shouldShowCancelButton: isSpace,
|
||||
|
||||
@@ -66,9 +66,9 @@ struct CreateRoomSpaceSelectionSheet_Previews: PreviewProvider, TestablePreview
|
||||
let clientProxy = ClientProxyMock(.init(userID: "@userid:example.com"))
|
||||
clientProxy.spaceService = SpaceServiceProxyMock(.init(editableSpaces: .mockJoinedSpaces2))
|
||||
let userSession = UserSessionMock(.init(clientProxy: clientProxy))
|
||||
|
||||
|
||||
let appSettings = AppSettings.volatile()
|
||||
|
||||
|
||||
return CreateRoomScreenViewModel(isSpace: false,
|
||||
spaceSelectionMode: .editableSpacesList(preSelectedSpace: nil),
|
||||
shouldShowCancelButton: false,
|
||||
|
||||
Reference in New Issue
Block a user