mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +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:
@@ -2363,11 +2363,11 @@ class RoomTimelineProviderMock: RoomTimelineProviderProtocol {
|
||||
|
||||
}
|
||||
class SecureBackupControllerMock: SecureBackupControllerProtocol {
|
||||
var recoveryKeyState: CurrentValuePublisher<SecureBackupRecoveryKeyState, Never> {
|
||||
get { return underlyingRecoveryKeyState }
|
||||
set(value) { underlyingRecoveryKeyState = value }
|
||||
var recoveryState: CurrentValuePublisher<SecureBackupRecoveryState, Never> {
|
||||
get { return underlyingRecoveryState }
|
||||
set(value) { underlyingRecoveryState = value }
|
||||
}
|
||||
var underlyingRecoveryKeyState: CurrentValuePublisher<SecureBackupRecoveryKeyState, Never>!
|
||||
var underlyingRecoveryState: CurrentValuePublisher<SecureBackupRecoveryState, Never>!
|
||||
var keyBackupState: CurrentValuePublisher<SecureBackupKeyBackupState, Never> {
|
||||
get { return underlyingKeyBackupState }
|
||||
set(value) { underlyingKeyBackupState = value }
|
||||
@@ -2446,23 +2446,6 @@ class SecureBackupControllerMock: SecureBackupControllerProtocol {
|
||||
return confirmRecoveryKeyReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - isLastSession
|
||||
|
||||
var isLastSessionCallsCount = 0
|
||||
var isLastSessionCalled: Bool {
|
||||
return isLastSessionCallsCount > 0
|
||||
}
|
||||
var isLastSessionReturnValue: Result<Bool, SecureBackupControllerError>!
|
||||
var isLastSessionClosure: (() async -> Result<Bool, SecureBackupControllerError>)?
|
||||
|
||||
func isLastSession() async -> Result<Bool, SecureBackupControllerError> {
|
||||
isLastSessionCallsCount += 1
|
||||
if let isLastSessionClosure = isLastSessionClosure {
|
||||
return await isLastSessionClosure()
|
||||
} else {
|
||||
return isLastSessionReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - waitForKeyBackupUpload
|
||||
|
||||
var waitForKeyBackupUploadCallsCount = 0
|
||||
|
||||
Reference in New Issue
Block a user