Update files following swiftformat upgrade

This commit is contained in:
Stefan Ceriu
2026-01-27 08:47:03 +02:00
committed by Stefan Ceriu
parent fe189fcfed
commit 23062901c0
343 changed files with 1502 additions and 1048 deletions
@@ -26,12 +26,14 @@ enum LoginScreenCoordinatorAction {
case signedIn(UserSessionProtocol)
}
// Note: This code was brought over from Riot, we should move the authentication service logic into the view model.
/// Note: This code was brought over from Riot, we should move the authentication service logic into the view model.
final class LoginScreenCoordinator: CoordinatorProtocol {
private let parameters: LoginScreenCoordinatorParameters
private var viewModel: LoginScreenViewModelProtocol
private var authenticationService: AuthenticationServiceProtocol { parameters.authenticationService }
private var authenticationService: AuthenticationServiceProtocol {
parameters.authenticationService
}
private let actionsSubject: PassthroughSubject<LoginScreenCoordinatorAction, Never> = .init()
private var cancellables = Set<AnyCancellable>()
@@ -31,7 +31,9 @@ struct LoginScreenViewState: BindableState {
var bindings = LoginScreenBindings()
/// The types of login supported by the homeserver.
var loginMode: LoginMode { homeserver.loginMode }
var loginMode: LoginMode {
homeserver.loginMode
}
/// `true` if the username and password are ready to be submitted.
var hasValidCredentials: Bool {
@@ -103,7 +103,9 @@ class OIDCAuthenticationPresenter: NSObject {
// MARK: ASWebAuthenticationPresentationContextProviding
extension OIDCAuthenticationPresenter: ASWebAuthenticationPresentationContextProviding {
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor { presentationAnchor }
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
presentationAnchor
}
}
extension ASWebAuthenticationSession.Callback {
@@ -103,9 +103,9 @@ struct ServerConfirmationScreen: View {
}
}
// This is such a hack. I hate it!
// But… We're not in a List/Form, the compound picker doesn't
// support icons and this screen's design might change so 🤷‍♂️.
/// This is such a hack. I hate it!
/// But… We're not in a List/Form, the compound picker doesn't
/// support icons and this screen's design might change so 🤷‍♂️.
private struct FakeInlinePicker: View {
let items: [String]
let icon: KeyPath<CompoundIcons, Image>
@@ -22,12 +22,14 @@ enum ServerSelectionScreenCoordinatorAction {
case dismiss
}
// Note: This code was brought over from Riot, we should move the authentication service logic into the view model.
/// Note: This code was brought over from Riot, we should move the authentication service logic into the view model.
final class ServerSelectionScreenCoordinator: CoordinatorProtocol {
private let parameters: ServerSelectionScreenCoordinatorParameters
private let userIndicatorController: UserIndicatorControllerProtocol
private var viewModel: ServerSelectionScreenViewModelProtocol
private var authenticationService: AuthenticationServiceProtocol { parameters.authenticationService }
private var authenticationService: AuthenticationServiceProtocol {
parameters.authenticationService
}
private let actionsSubject: PassthroughSubject<ServerSelectionScreenCoordinatorAction, Never> = .init()
private var cancellables = Set<AnyCancellable>()
@@ -34,14 +34,17 @@ enum SoftLogoutScreenCoordinatorResult: CustomStringConvertible {
}
}
// Note: This code was brought over from Riot, we should move the authentication service logic into the view model.
/// Note: This code was brought over from Riot, we should move the authentication service logic into the view model.
final class SoftLogoutScreenCoordinator: CoordinatorProtocol {
private let parameters: SoftLogoutScreenCoordinatorParameters
private var viewModel: SoftLogoutScreenViewModelProtocol
private let actionsSubject: PassthroughSubject<SoftLogoutScreenCoordinatorResult, Never> = .init()
private var cancellables = Set<AnyCancellable>()
private var authenticationService: AuthenticationServiceProtocol { parameters.authenticationService }
private var authenticationService: AuthenticationServiceProtocol {
parameters.authenticationService
}
private var oidcPresenter: OIDCAuthenticationPresenter?
var actions: AnyPublisher<SoftLogoutScreenCoordinatorResult, Never> {
@@ -54,7 +54,9 @@ struct SoftLogoutScreenViewState: BindableState {
var bindings: SoftLogoutScreenBindings
/// The types of login supported by the homeserver.
var loginMode: LoginMode { homeserver.loginMode }
var loginMode: LoginMode {
homeserver.loginMode
}
/// The presentation anchor used for OIDC authentication.
var window: UIWindow?
@@ -20,7 +20,9 @@ struct AuthenticationStartLogo: View {
/// The shape that the logo is composed on top of.
private let outerShape = RoundedRectangle(cornerRadius: 44)
private let outerShapeShadowColor = Color(red: 0.11, green: 0.11, blue: 0.13)
private var isLight: Bool { colorScheme == .light }
private var isLight: Bool {
colorScheme == .light
}
var body: some View {
if hideBrandChrome {