mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Adopt StateStoreViewModelV2 in the remaining settings screens. (#4158)
* Move the AuthenticationStartScreen into the Authentication directory.
* Commit the updated Sentry license.
No idea why they dropped the 2024 🤷♂️
* Use StateStoreViewModelV2 in BugReportScreen.
* Use StateStoreViewModelV2 in UserDetailsEditScreen.
* Use StateStoreViewModelV2 in NotificationSettingsScreen.
* Use StateStoreViewModelV2 in NotificationSettingsEditScreen.
* Use StateStoreViewModelV2 in LegalInformationScreen.
* Use StateStoreViewModelV2 in LogViewerScreen.
* Use StateStoreViewModelV2 in AnalyticsSettingsScreen.
* Rename AdvancedSettingsScreen directory.
* Use StateStoreViewModelV2 in EncryptionResetScreen.
* Use StateStoreViewModelV2 in EncryptionResetPasswordScreen.
* Use StateStoreViewModelV2 in SecureBackup…Screens.
* Use StateStoreViewModelV2 in LoginScreen.
Seems this one was ignored waiting on the fulfillment transitionValues implementation.
* Use StateStoreViewModelV2 in DeactivateAccountScreen.
* Move DeactivateAccountScreen into the Settings directory.
This commit is contained in:
+70
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// Copyright 2022-2024 New Vector Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
// MARK: - Coordinator
|
||||
|
||||
enum AuthenticationStartScreenCoordinatorAction {
|
||||
case loginWithQR
|
||||
case login
|
||||
case register
|
||||
case reportProblem
|
||||
|
||||
case loginDirectlyWithOIDC(data: OIDCAuthorizationDataProxy, window: UIWindow)
|
||||
case loginDirectlyWithPassword(loginHint: String?)
|
||||
}
|
||||
|
||||
enum AuthenticationStartScreenViewModelAction: Equatable {
|
||||
case loginWithQR
|
||||
case login
|
||||
case register
|
||||
case reportProblem
|
||||
|
||||
case loginDirectlyWithOIDC(data: OIDCAuthorizationDataProxy, window: UIWindow)
|
||||
case loginDirectlyWithPassword(loginHint: String?)
|
||||
}
|
||||
|
||||
struct AuthenticationStartScreenViewState: BindableState {
|
||||
/// The presentation anchor used for OIDC authentication.
|
||||
var window: UIWindow?
|
||||
|
||||
let serverName: String?
|
||||
let showCreateAccountButton: Bool
|
||||
let showQRCodeLoginButton: Bool
|
||||
let showReportProblemButton: Bool
|
||||
|
||||
var bindings = AuthenticationStartScreenViewStateBindings()
|
||||
|
||||
var loginButtonTitle: String {
|
||||
if let serverName {
|
||||
L10n.screenOnboardingSignInTo(serverName)
|
||||
} else if showQRCodeLoginButton {
|
||||
L10n.screenOnboardingSignInManually
|
||||
} else {
|
||||
L10n.actionContinue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct AuthenticationStartScreenViewStateBindings {
|
||||
var alertInfo: AlertInfo<AuthenticationStartScreenAlertType>?
|
||||
}
|
||||
|
||||
enum AuthenticationStartScreenAlertType {
|
||||
case genericError
|
||||
}
|
||||
|
||||
enum AuthenticationStartScreenViewAction {
|
||||
/// Updates the window used as the OIDC presentation anchor.
|
||||
case updateWindow(UIWindow)
|
||||
|
||||
case loginWithQR
|
||||
case login
|
||||
case register
|
||||
case reportProblem
|
||||
}
|
||||
Reference in New Issue
Block a user