mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Show internet connection warning when uploading keys on log out. (#4027)
* Show the key upload progress when waiting to log out. Add some basic view model tests too. * Show a network suggestion if key upload doesn't report any progress during logout.
This commit is contained in:
@@ -27,6 +27,14 @@ enum SecureBackupKeyBackupState {
|
||||
case disabling
|
||||
}
|
||||
|
||||
/// Represents the progress towards a complete backup before logging out.
|
||||
enum SecureBackupSteadyState {
|
||||
case waiting
|
||||
case uploading(uploadedKeyCount: Int, totalKeyCount: Int)
|
||||
case error
|
||||
case done
|
||||
}
|
||||
|
||||
enum SecureBackupControllerError: Error {
|
||||
case failedEnablingBackup
|
||||
case failedDisablingBackup
|
||||
@@ -49,5 +57,5 @@ protocol SecureBackupControllerProtocol {
|
||||
func generateRecoveryKey() async -> Result<String, SecureBackupControllerError>
|
||||
func confirmRecoveryKey(_ key: String) async -> Result<Void, SecureBackupControllerError>
|
||||
|
||||
func waitForKeyBackupUpload() async -> Result<Void, SecureBackupControllerError>
|
||||
func waitForKeyBackupUpload(uploadStateSubject: CurrentValueSubject<SecureBackupSteadyState, Never>) async -> Result<Void, SecureBackupControllerError>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user