Secure backup tweaks (#2122)

* Show the recovery section if key backup is anything **but** disabled

* Don't show an action on secure backup if its current state is unknown

* Do not show a badge on the home screen avatar while the recovery state is unknown

* Do not assume key backup is disabled when its state is unknown. If the state is unknown, check if a backup exists remotely.

* Dedupe remote backup state requests and handle task cancellations
This commit is contained in:
Stefan Ceriu
2023-11-21 10:59:10 +02:00
committed by GitHub
parent 291034b688
commit bec6cdac05
3 changed files with 43 additions and 5 deletions
@@ -23,7 +23,7 @@ struct SecureBackupScreen: View {
var body: some View {
Form {
if context.viewState.keyBackupState != .enabled {
if context.viewState.keyBackupState == .disabled {
keyBackupSection
} else {
keyBackupSection
@@ -77,10 +77,12 @@ struct SecureBackupScreen: View {
ListRow(label: .plain(title: L10n.screenChatBackupKeyBackupActionDisable, role: .destructive), kind: .navigationLink {
context.send(viewAction: .keyBackup)
})
case .disabled, .enabling, .unknown:
case .disabled, .enabling:
ListRow(label: .plain(title: L10n.screenChatBackupKeyBackupActionEnable), kind: .navigationLink {
context.send(viewAction: .keyBackup)
})
case .unknown:
EmptyView()
}
}