mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 09:02:44 +02:00
Configured and applied SwiftFormat
This commit is contained in:
committed by
Stefan Ceriu
parent
ff2e6ddfa7
commit
43c28d23b7
+4
-5
@@ -1,6 +1,6 @@
|
||||
// File created from SimpleUserProfileExample
|
||||
// $ createScreen.sh Spaces/SpaceCreation/SpaceCreationEmailInvites SpaceCreationEmailInvites
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -16,11 +16,10 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
class SpaceCreationEmailInvitesService: SpaceCreationEmailInvitesServiceProtocol {
|
||||
|
||||
private let session: MXSession
|
||||
private(set) var isLoadingSubject: CurrentValueSubject<Bool, Never>
|
||||
|
||||
@@ -37,12 +36,12 @@ class SpaceCreationEmailInvitesService: SpaceCreationEmailInvitesServiceProtocol
|
||||
}
|
||||
|
||||
func validate(_ emailAddresses: [String]) -> [Bool] {
|
||||
return emailAddresses.map { $0.isEmpty || MXTools.isEmailAddress($0) }
|
||||
emailAddresses.map { $0.isEmpty || MXTools.isEmailAddress($0) }
|
||||
}
|
||||
|
||||
func prepareIdentityService(prepared: ((String?, String?) -> Void)?, failure: ((Error?) -> Void)?) {
|
||||
isLoadingSubject.send(true)
|
||||
session.prepareIdentityServiceForTerms(withDefault: RiotSettings.shared.identityServerUrlString) { [weak self] session, baseURL, accessToken in
|
||||
session.prepareIdentityServiceForTerms(withDefault: RiotSettings.shared.identityServerUrlString) { [weak self] _, baseURL, accessToken in
|
||||
self?.isLoadingSubject.send(false)
|
||||
prepared?(baseURL, accessToken)
|
||||
} failure: { [weak self] error in
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// File created from SimpleUserProfileExample
|
||||
// $ createScreen.sh Spaces/SpaceCreation/SpaceCreationEmailInvites SpaceCreationEmailInvites
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -41,7 +41,7 @@ enum MockSpaceCreationEmailInvitesScreenState: MockScreenState, CaseIterable {
|
||||
}
|
||||
|
||||
/// Generate the view struct for the screen state.
|
||||
var screenView: ([Any], AnyView) {
|
||||
var screenView: ([Any], AnyView) {
|
||||
let creationParams = SpaceCreationParameters()
|
||||
let service: MockSpaceCreationEmailInvitesService
|
||||
switch self {
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
// File created from SimpleUserProfileExample
|
||||
// $ createScreen.sh Spaces/SpaceCreation/SpaceCreationEmailInvites SpaceCreationEmailInvites
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -16,8 +16,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
class MockSpaceCreationEmailInvitesService: SpaceCreationEmailInvitesServiceProtocol {
|
||||
var isLoadingSubject: CurrentValueSubject<Bool, Never>
|
||||
@@ -25,16 +25,16 @@ class MockSpaceCreationEmailInvitesService: SpaceCreationEmailInvitesServiceProt
|
||||
private let defaultValidation: Bool
|
||||
|
||||
var isIdentityServiceReady: Bool {
|
||||
return true
|
||||
true
|
||||
}
|
||||
|
||||
init(defaultValidation: Bool, isLoading: Bool) {
|
||||
self.defaultValidation = defaultValidation
|
||||
self.isLoadingSubject = CurrentValueSubject(isLoading)
|
||||
isLoadingSubject = CurrentValueSubject(isLoading)
|
||||
}
|
||||
|
||||
func validate(_ emailAddresses: [String]) -> [Bool] {
|
||||
return emailAddresses.map { _ in defaultValidation }
|
||||
emailAddresses.map { _ in defaultValidation }
|
||||
}
|
||||
|
||||
func prepareIdentityService(prepared: ((String?, String?) -> Void)?, failure: ((Error?) -> Void)?) {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// File created from SimpleUserProfileExample
|
||||
// $ createScreen.sh Spaces/SpaceCreation/SpaceCreationEmailInvites SpaceCreationEmailInvites
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -16,8 +16,8 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
protocol SpaceCreationEmailInvitesServiceProtocol {
|
||||
var isIdentityServiceReady: Bool { get }
|
||||
|
||||
Reference in New Issue
Block a user