Update the strings for out of sync Key Storage. (#3468)

* Update the banner strings for out of sync key storage.

* Update string on SecureBackupScreen.

* Update snapshots

* Update an alert string we weren't using on iOS, and use it at the same place as Android.
This commit is contained in:
Doug
2024-10-31 11:33:11 +00:00
committed by GitHub
parent 6f158264fa
commit 0da225205b
16 changed files with 76 additions and 52 deletions
+7 -3
View File
@@ -536,9 +536,13 @@ internal enum L10n {
internal static var commonWaiting: String { return L10n.tr("Localizable", "common_waiting") }
/// Waiting for this message
internal static var commonWaitingForDecryptionKey: String { return L10n.tr("Localizable", "common_waiting_for_decryption_key") }
/// Your chat backup is currently out of sync. You need to enter your recovery key to maintain access to your chat backup.
/// Confirm your recovery key to maintain access to your key storage and message history.
internal static var confirmRecoveryKeyBannerMessage: String { return L10n.tr("Localizable", "confirm_recovery_key_banner_message") }
/// Enter your recovery key
internal static var confirmRecoveryKeyBannerPrimaryButtonTitle: String { return L10n.tr("Localizable", "confirm_recovery_key_banner_primary_button_title") }
/// Forgot your recovery key?
internal static var confirmRecoveryKeyBannerSecondaryButtonTitle: String { return L10n.tr("Localizable", "confirm_recovery_key_banner_secondary_button_title") }
/// Your key storage is out of sync
internal static var confirmRecoveryKeyBannerTitle: String { return L10n.tr("Localizable", "confirm_recovery_key_banner_title") }
/// %1$@ crashed the last time it was used. Would you like to share a crash report with us?
internal static func crashDetectionDialogContent(_ p1: Any) -> String {
@@ -1039,7 +1043,7 @@ internal enum L10n {
internal static var screenChatBackupRecoveryActionChangeDescription: String { return L10n.tr("Localizable", "screen_chat_backup_recovery_action_change_description") }
/// Enter recovery key
internal static var screenChatBackupRecoveryActionConfirm: String { return L10n.tr("Localizable", "screen_chat_backup_recovery_action_confirm") }
/// Your chat backup is currently out of sync.
/// Your key storage is currently out of sync.
internal static var screenChatBackupRecoveryActionConfirmDescription: String { return L10n.tr("Localizable", "screen_chat_backup_recovery_action_confirm_description") }
/// Set up recovery
internal static var screenChatBackupRecoveryActionSetup: String { return L10n.tr("Localizable", "screen_chat_backup_recovery_action_setup") }
@@ -1516,7 +1520,7 @@ internal enum L10n {
internal static var screenRecoveryKeyConfirmCreateNewRecoveryKey: String { return L10n.tr("Localizable", "screen_recovery_key_confirm_create_new_recovery_key") }
/// Make sure nobody can see this screen!
internal static var screenRecoveryKeyConfirmDescription: String { return L10n.tr("Localizable", "screen_recovery_key_confirm_description") }
/// Please try again to confirm access to your chat backup.
/// Please try again to confirm access to your key storage.
internal static var screenRecoveryKeyConfirmErrorContent: String { return L10n.tr("Localizable", "screen_recovery_key_confirm_error_content") }
/// Incorrect recovery key
internal static var screenRecoveryKeyConfirmErrorTitle: String { return L10n.tr("Localizable", "screen_recovery_key_confirm_error_title") }
@@ -6,6 +6,7 @@
//
import Combine
import Compound
import SwiftUI
struct HomeScreenRecoveryKeyConfirmationBanner: View {
@@ -14,18 +15,28 @@ struct HomeScreenRecoveryKeyConfirmationBanner: View {
var title: String { requiresExtraAccountSetup ? L10n.bannerSetUpRecoveryTitle : L10n.confirmRecoveryKeyBannerTitle }
var message: String { requiresExtraAccountSetup ? L10n.bannerSetUpRecoveryContent : L10n.confirmRecoveryKeyBannerMessage }
var actionTitle: String { requiresExtraAccountSetup ? L10n.bannerSetUpRecoverySubmit : L10n.actionContinue }
var actionTitle: String { requiresExtraAccountSetup ? L10n.bannerSetUpRecoverySubmit : L10n.confirmRecoveryKeyBannerPrimaryButtonTitle }
var body: some View {
VStack(alignment: .leading, spacing: 16) {
VStack(alignment: .leading, spacing: 4) {
HStack(spacing: 16) {
Text(title)
.font(.compound.bodyLGSemibold)
.foregroundColor(.compound.textPrimary)
Spacer()
VStack(spacing: 16) {
content
buttons
}
.padding(16)
.background(Color.compound.bgSubtleSecondary)
.cornerRadius(14)
.padding(.horizontal, 16)
}
var content: some View {
VStack(alignment: .leading, spacing: 4) {
HStack(alignment: .firstTextBaseline, spacing: 16) {
Text(title)
.font(.compound.bodyLGSemibold)
.foregroundColor(.compound.textPrimary)
.frame(maxWidth: .infinity, alignment: .leading)
if requiresExtraAccountSetup {
Button {
context.send(viewAction: .skipRecoveryKeyConfirmation)
} label: {
@@ -34,22 +45,27 @@ struct HomeScreenRecoveryKeyConfirmationBanner: View {
.frame(width: 12, height: 12)
}
}
Text(message)
.font(.compound.bodyMD)
.foregroundColor(.compound.textSecondary)
}
Text(message)
.font(.compound.bodyMD)
.foregroundColor(.compound.textSecondary)
}
}
var buttons: some View {
VStack(spacing: 16) {
Button(actionTitle) {
context.send(viewAction: .confirmRecoveryKey)
}
.frame(maxWidth: .infinity)
.buttonStyle(.compound(.primary, size: .medium))
.accessibilityIdentifier(A11yIdentifiers.homeScreen.recoveryKeyConfirmationBannerContinue)
if !requiresExtraAccountSetup {
// Missing encryption reset button to goes here once the flow exists.
}
}
.padding(16)
.background(Color.compound.bgSubtleSecondary)
.cornerRadius(14)
.padding(.horizontal, 16)
}
}
@@ -65,7 +65,9 @@ class SecureBackupRecoveryKeyScreenViewModel: SecureBackupRecoveryKeyScreenViewM
actionsSubject.send(.done(mode: context.viewState.mode))
case .failure(let error):
MXLog.error("Failed confirming recovery key with error: \(error)")
state.bindings.alertInfo = .init(id: .init())
state.bindings.alertInfo = .init(id: .init(),
title: L10n.screenRecoveryKeyConfirmErrorTitle,
message: L10n.screenRecoveryKeyConfirmErrorContent)
}
hideLoadingIndicator()