Show recover encryption keys message according to key backup requirement

This commit is contained in:
ismailgulek
2022-06-08 17:39:51 +03:00
parent 096164f10f
commit 8a5c9f3592
8 changed files with 52 additions and 13 deletions
@@ -42,11 +42,15 @@ enum AuthenticationSoftLogoutViewModelResult {
// MARK: View
struct AuthenticationSoftLogoutViewState: BindableState {
/// Soft logout credentials
var credentials: SoftLogoutCredentials
/// Data about the selected homeserver.
var homeserver: AuthenticationHomeserverViewData
/// Flag indicating soft logged out user needs backup for some keys
var keyBackupNeeded: Bool
/// View state that can be bound to from SwiftUI.
var bindings: AuthenticationSoftLogoutBindings
@@ -59,6 +63,11 @@ struct AuthenticationSoftLogoutViewState: BindableState {
var showSSOButtons: Bool {
!homeserver.ssoIdentityProviders.isEmpty
}
/// Whether to show recover encryption keys message
var showRecoverEncryptionKeysMessage: Bool {
keyBackupNeeded
}
/// Whether the password is valid and the user can continue.
var hasInvalidPassword: Bool {