Remove unnecessary marks, they bring little value

This commit is contained in:
Stefan Ceriu
2022-11-28 10:32:32 +02:00
committed by Stefan Ceriu
parent 198127c5d7
commit 9589c689c3
40 changed files with 0 additions and 274 deletions
@@ -16,8 +16,6 @@
import Foundation
// MARK: View model
enum LoginViewModelAction: CustomStringConvertible {
/// The user would like to select another server.
case selectServer
@@ -47,8 +45,6 @@ enum LoginViewModelAction: CustomStringConvertible {
}
}
// MARK: View
struct LoginViewState: BindableState {
/// Data about the selected homeserver.
var homeserver: LoginHomeserver
@@ -19,22 +19,14 @@ import SwiftUI
typealias LoginViewModelType = StateStoreViewModel<LoginViewState, LoginViewAction>
class LoginViewModel: LoginViewModelType, LoginViewModelProtocol {
// MARK: - Properties
// MARK: Public
var callback: (@MainActor (LoginViewModelAction) -> Void)?
// MARK: - Setup
init(homeserver: LoginHomeserver) {
let bindings = LoginBindings()
let viewState = LoginViewState(homeserver: homeserver, bindings: bindings)
super.init(initialViewState: viewState)
}
// MARK: - Public
override func process(viewAction: LoginViewAction) async {
switch viewAction {
@@ -17,17 +17,11 @@
import SwiftUI
struct LoginScreen: View {
// MARK: - Properties
// MARK: Private
/// The focus state of the username text field.
@FocusState private var isUsernameFocused: Bool
/// The focus state of the password text field.
@FocusState private var isPasswordFocused: Bool
// MARK: Public
@ObservedObject var context: LoginViewModel.Context
var body: some View {
@@ -16,8 +16,6 @@
import Foundation
// MARK: View model
enum ServerSelectionViewModelAction {
/// The user would like to use the homeserver at the given address.
case confirm(homeserverAddress: String)
@@ -25,8 +23,6 @@ enum ServerSelectionViewModelAction {
case dismiss
}
// MARK: View
struct ServerSelectionViewState: BindableState {
/// View state that can be bound to from SwiftUI.
var bindings: ServerSelectionBindings
@@ -19,16 +19,8 @@ import SwiftUI
typealias ServerSelectionViewModelType = StateStoreViewModel<ServerSelectionViewState, ServerSelectionViewAction>
class ServerSelectionViewModel: ServerSelectionViewModelType, ServerSelectionViewModelProtocol {
// MARK: - Properties
// MARK: Private
// MARK: Public
var callback: (@MainActor (ServerSelectionViewModelAction) -> Void)?
// MARK: - Setup
init(homeserverAddress: String, isModallyPresented: Bool) {
let bindings = ServerSelectionBindings(homeserverAddress: homeserverAddress,
slidingSyncProxyAddress: ElementSettings.shared.slidingSyncProxyBaseURLString)
@@ -36,8 +28,6 @@ class ServerSelectionViewModel: ServerSelectionViewModelType, ServerSelectionVie
super.init(initialViewState: ServerSelectionViewState(bindings: bindings,
isModallyPresented: isModallyPresented))
}
// MARK: - Public
override func process(viewAction: ServerSelectionViewAction) async {
switch viewAction {
@@ -16,8 +16,6 @@
import SwiftUI
// MARK: Data
struct SoftLogoutCredentials {
let userId: String
let homeserverName: String
@@ -25,8 +23,6 @@ struct SoftLogoutCredentials {
let deviceId: String?
}
// MARK: View model
enum SoftLogoutViewModelAction: CustomStringConvertible {
/// Login with password
case login(String)
@@ -52,8 +48,6 @@ enum SoftLogoutViewModelAction: CustomStringConvertible {
}
}
// MARK: View
struct SoftLogoutViewState: BindableState {
/// Soft logout credentials
var credentials: SoftLogoutCredentials
@@ -19,16 +19,8 @@ import SwiftUI
typealias SoftLogoutViewModelType = StateStoreViewModel<SoftLogoutViewState, SoftLogoutViewAction>
class SoftLogoutViewModel: SoftLogoutViewModelType, SoftLogoutViewModelProtocol {
// MARK: - Properties
// MARK: Private
// MARK: Public
var callback: (@MainActor (SoftLogoutViewModelAction) -> Void)?
// MARK: - Setup
init(credentials: SoftLogoutCredentials,
homeserver: LoginHomeserver,
keyBackupNeeded: Bool,
@@ -40,8 +32,6 @@ class SoftLogoutViewModel: SoftLogoutViewModelType, SoftLogoutViewModelProtocol
bindings: bindings)
super.init(initialViewState: viewState)
}
// MARK: - Public
override func process(viewAction: SoftLogoutViewAction) async {
switch viewAction {
@@ -17,21 +17,13 @@
import SwiftUI
struct SoftLogoutScreen: View {
// MARK: - Properties
// MARK: Private
@State private var showingClearDataConfirmation = false
/// The focus state of the password text field.
@FocusState private var isPasswordFocused: Bool
// MARK: Public
@ObservedObject var context: SoftLogoutViewModel.Context
// MARK: Views
var body: some View {
ScrollView {
VStack(spacing: 0) {