Tweak the flow for changing a recovery key. (#3452)

* Rename Chat Backup setting to Encryption.

* Update Key Storage strings on SecureBackupScreen.

* Update strings/design on SecureBackupRecoveryKeyScreen.
This commit is contained in:
Doug
2024-10-28 12:28:13 +00:00
committed by GitHub
parent 4e812f72b9
commit 7c28d9709f
43 changed files with 175 additions and 116 deletions
@@ -39,7 +39,7 @@ struct SecureBackupScreen: View {
private var keyBackupSection: some View {
Section {
ListRow(kind: .custom {
VStack(alignment: .leading, spacing: 2) {
VStack(alignment: .leading, spacing: 8) {
Text(L10n.screenChatBackupKeyBackupTitle)
.font(.compound.bodyLGSemibold)
.foregroundColor(.compound.textPrimary)
@@ -53,7 +53,7 @@ struct SecureBackupScreen: View {
.accessibilityElement(children: .combine)
})
keyBackupButton
keyStorageToggle
}
}
@@ -67,26 +67,23 @@ struct SecureBackupScreen: View {
return description
}
@ViewBuilder
private var keyBackupButton: some View {
switch context.viewState.keyBackupState {
case .enabled, .disabling:
ListRow(label: .plain(title: L10n.screenChatBackupKeyBackupActionDisable, role: .destructive), kind: .navigationLink {
context.send(viewAction: .keyBackup)
})
case .unknown, .enabling:
ListRow(label: .plain(title: L10n.screenChatBackupKeyBackupActionEnable), kind: .navigationLink {
context.send(viewAction: .keyBackup)
})
}
private var keyStorageToggle: some View {
ListRow(label: .plain(title: L10n.screenChatBackupKeyStorageToggleTitle,
description: L10n.screenChatBackupKeyStorageToggleDescription),
kind: .toggle($context.keyStorageEnabled))
.onChange(of: context.keyStorageEnabled) { _, newValue in
context.send(viewAction: .keyStorageToggled(newValue))
}
}
@ViewBuilder
private var recoveryKeySection: some View {
Section {
switch context.viewState.recoveryState {
case .enabled:
ListRow(label: .plain(title: L10n.screenChatBackupRecoveryActionChange),
ListRow(label: .default(title: L10n.screenChatBackupRecoveryActionChange,
description: L10n.screenChatBackupRecoveryActionChangeDescription,
icon: \.key,
iconAlignment: .top),
kind: .navigationLink { context.send(viewAction: .recoveryKey) })
case .disabled:
ListRow(label: .plain(title: L10n.screenChatBackupRecoveryActionSetup),