mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Update the SDK, minor version, handle API breaks (#1994)
This commit is contained in:
+9
@@ -30,6 +30,15 @@ enum SecureBackupLogoutConfirmationScreenViewMode {
|
||||
|
||||
struct SecureBackupLogoutConfirmationScreenViewState: BindableState {
|
||||
var mode: SecureBackupLogoutConfirmationScreenViewMode
|
||||
var bindings = SecureBackupLogoutConfirmationScreenBindings()
|
||||
}
|
||||
|
||||
struct SecureBackupLogoutConfirmationScreenBindings {
|
||||
var alertInfo: AlertInfo<SecureBackupLogoutConfirmationScreenAlertType>?
|
||||
}
|
||||
|
||||
enum SecureBackupLogoutConfirmationScreenAlertType {
|
||||
case backupUploadFailed
|
||||
}
|
||||
|
||||
enum SecureBackupLogoutConfirmationScreenViewAction {
|
||||
|
||||
+12
-1
@@ -77,7 +77,18 @@ class SecureBackupLogoutConfirmationScreenViewModel: SecureBackupLogoutConfirmat
|
||||
state.mode = networkMonitor.reachabilityPublisher.value == .reachable ? .backupOngoing : .offline
|
||||
|
||||
keyUploadWaitingTask = Task {
|
||||
await secureBackupController.waitForKeyBackup()
|
||||
var result = await secureBackupController.waitForKeyBackupUpload()
|
||||
|
||||
if case .failure = result {
|
||||
// Retry the upload first, conditions might have changed.
|
||||
result = await secureBackupController.waitForKeyBackupUpload()
|
||||
}
|
||||
|
||||
guard case .success = result else {
|
||||
MXLog.error("Aborting logout due to failure waiting for backup upload.")
|
||||
state.bindings.alertInfo = .init(id: .backupUploadFailed)
|
||||
return
|
||||
}
|
||||
|
||||
guard !Task.isCancelled else { return }
|
||||
|
||||
|
||||
+1
@@ -33,6 +33,7 @@ struct SecureBackupLogoutConfirmationScreen: View {
|
||||
.toolbar { toolbar }
|
||||
.background(Color.compound.bgCanvasDefault.ignoresSafeArea())
|
||||
.safeAreaInset(edge: .bottom) { footer.padding() }
|
||||
.alert(item: $context.alertInfo)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user