mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 03:48:27 +00:00
Show recovery instead of verification if this is the last session and recovery is set up
* Show recovery instead of verification if this is the last session and recovery is set up * Rename `recoveryKeyState` to `recoveryState` * Remove duplicates on session security state changes. * Fix missing "Save recovery key" button * Fix unit tests * Rename `isLastDevice` to `isOnlyDeviceLeft` * Address PR comments
This commit is contained in:
@@ -75,33 +75,21 @@ enum HomeScreenRoomListMode: CustomStringConvertible {
|
||||
}
|
||||
}
|
||||
|
||||
enum SecurityBannerMode {
|
||||
case none
|
||||
case dismissed
|
||||
case sessionVerification
|
||||
case recoveryKeyConfirmation
|
||||
}
|
||||
|
||||
struct HomeScreenViewState: BindableState {
|
||||
let userID: String
|
||||
var userDisplayName: String?
|
||||
var userAvatarURL: URL?
|
||||
|
||||
var isSessionVerified: Bool?
|
||||
var hasSessionVerificationBannerBeenDismissed = false
|
||||
var showSessionVerificationBanner: Bool {
|
||||
guard let isSessionVerified else {
|
||||
return false
|
||||
}
|
||||
var securityBannerMode = SecurityBannerMode.none
|
||||
var requiresExtraAccountSetup = false
|
||||
|
||||
return !isSessionVerified && !hasSessionVerificationBannerBeenDismissed
|
||||
}
|
||||
|
||||
var requiresSecureBackupSetup = false
|
||||
|
||||
var needsRecoveryKeyConfirmation = false
|
||||
var hasRecoveryKeyConfirmationBannerBeenDismissed = false
|
||||
var showRecoveryKeyConfirmationBanner: Bool {
|
||||
guard let isSessionVerified else {
|
||||
return false
|
||||
}
|
||||
|
||||
return isSessionVerified && needsRecoveryKeyConfirmation && !hasRecoveryKeyConfirmationBannerBeenDismissed
|
||||
}
|
||||
|
||||
var rooms: [HomeScreenRoom] = []
|
||||
var roomListMode: HomeScreenRoomListMode = .skeletons
|
||||
|
||||
|
||||
Reference in New Issue
Block a user