mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Tweak the flow for setting up a recovery key. (#3463)
* Remove unwanted title. * Update SecureBackupScreen strings. * Update SecureBackupRecoveryKeyScreen. * Show the recovery banner when recovery needs setting up. * Fix SecureBackupScreen title. * Fix timeout on MP4 encoding tests
This commit is contained in:
@@ -115,9 +115,9 @@
|
||||
"banner_migrate_to_native_sliding_sync_description" = "Your server now supports a new, faster protocol. Log out and log back in to upgrade now. Doing this now will help you avoid a forced logout when the old protocol is removed later.";
|
||||
"banner_migrate_to_native_sliding_sync_force_logout_title" = "Your homeserver no longer supports the old protocol. Please log out and log back in to continue using the app.";
|
||||
"banner_migrate_to_native_sliding_sync_title" = "Upgrade available";
|
||||
"banner_set_up_recovery_content" = "Recover your cryptographic identity and message history with a recovery key if you have lost all your existing devices.";
|
||||
"banner_set_up_recovery_submit" = "Set up recovery";
|
||||
"banner.set_up_recovery.content" = "Recover your cryptographic identity and message history with a recovery key if you have lost all your existing devices.";
|
||||
"banner.set_up_recovery.title" = "Set up recovery to protect your account";
|
||||
"banner_set_up_recovery_title" = "Set up recovery to protect your account";
|
||||
"common_about" = "About";
|
||||
"common_acceptable_use_policy" = "Acceptable use policy";
|
||||
"common_advanced_settings" = "Advanced settings";
|
||||
@@ -459,6 +459,7 @@
|
||||
"screen_chat_backup_key_backup_action_enable" = "Turn on backup";
|
||||
"screen_chat_backup_key_backup_description" = "Store your cryptographic identity and message keys securely on the server. This will allow you to view your message history on any new devices. %1$@.";
|
||||
"screen_chat_backup_key_backup_title" = "Key storage";
|
||||
"screen_chat_backup_key_storage_disabled_error" = "Key storage must be turned on to set up recovery.";
|
||||
"screen_chat_backup_key_storage_toggle_description" = "Upload keys from this device";
|
||||
"screen_chat_backup_key_storage_toggle_title" = "Allow key storage";
|
||||
"screen_chat_backup_recovery_action_change" = "Change recovery key";
|
||||
|
||||
@@ -266,8 +266,12 @@ internal enum L10n {
|
||||
internal static var bannerMigrateToNativeSlidingSyncForceLogoutTitle: String { return L10n.tr("Localizable", "banner_migrate_to_native_sliding_sync_force_logout_title") }
|
||||
/// Upgrade available
|
||||
internal static var bannerMigrateToNativeSlidingSyncTitle: String { return L10n.tr("Localizable", "banner_migrate_to_native_sliding_sync_title") }
|
||||
/// Recover your cryptographic identity and message history with a recovery key if you have lost all your existing devices.
|
||||
internal static var bannerSetUpRecoveryContent: String { return L10n.tr("Localizable", "banner_set_up_recovery_content") }
|
||||
/// Set up recovery
|
||||
internal static var bannerSetUpRecoverySubmit: String { return L10n.tr("Localizable", "banner_set_up_recovery_submit") }
|
||||
/// Set up recovery to protect your account
|
||||
internal static var bannerSetUpRecoveryTitle: String { return L10n.tr("Localizable", "banner_set_up_recovery_title") }
|
||||
/// About
|
||||
internal static var commonAbout: String { return L10n.tr("Localizable", "common_about") }
|
||||
/// Acceptable use policy
|
||||
@@ -1021,6 +1025,8 @@ internal enum L10n {
|
||||
}
|
||||
/// Key storage
|
||||
internal static var screenChatBackupKeyBackupTitle: String { return L10n.tr("Localizable", "screen_chat_backup_key_backup_title") }
|
||||
/// Key storage must be turned on to set up recovery.
|
||||
internal static var screenChatBackupKeyStorageDisabledError: String { return L10n.tr("Localizable", "screen_chat_backup_key_storage_disabled_error") }
|
||||
/// Upload keys from this device
|
||||
internal static var screenChatBackupKeyStorageToggleDescription: String { return L10n.tr("Localizable", "screen_chat_backup_key_storage_toggle_description") }
|
||||
/// Allow key storage
|
||||
@@ -2499,15 +2505,6 @@ internal enum L10n {
|
||||
/// Check UnifiedPush
|
||||
internal static var troubleshootNotificationsTestUnifiedPushTitle: String { return L10n.tr("Localizable", "troubleshoot_notifications_test_unified_push_title") }
|
||||
|
||||
internal enum Banner {
|
||||
internal enum SetUpRecovery {
|
||||
/// Recover your cryptographic identity and message history with a recovery key if you have lost all your existing devices.
|
||||
internal static var content: String { return L10n.tr("Localizable", "banner.set_up_recovery.content") }
|
||||
/// Set up recovery to protect your account
|
||||
internal static var title: String { return L10n.tr("Localizable", "banner.set_up_recovery.title") }
|
||||
}
|
||||
}
|
||||
|
||||
internal enum Common {
|
||||
/// Copied to clipboard
|
||||
internal static var copiedToClipboard: String { return L10n.tr("Localizable", "common.copied_to_clipboard") }
|
||||
|
||||
@@ -58,7 +58,7 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
switch (securityState.verificationState, securityState.recoveryState) {
|
||||
case (.verified, .disabled):
|
||||
state.requiresExtraAccountSetup = true
|
||||
state.securityBannerMode = .none
|
||||
state.securityBannerMode = .show
|
||||
case (.verified, .incomplete):
|
||||
state.requiresExtraAccountSetup = true
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ struct HomeScreenContent: View {
|
||||
if context.viewState.slidingSyncMigrationBannerMode == .show {
|
||||
HomeScreenSlidingSyncMigrationBanner(context: context)
|
||||
} else if context.viewState.securityBannerMode == .show {
|
||||
HomeScreenRecoveryKeyConfirmationBanner(context: context)
|
||||
HomeScreenRecoveryKeyConfirmationBanner(requiresExtraAccountSetup: context.viewState.requiresExtraAccountSetup, context: context)
|
||||
}
|
||||
}
|
||||
.background(Color.compound.bgCanvasDefault)
|
||||
|
||||
+14
-4
@@ -9,13 +9,18 @@ import Combine
|
||||
import SwiftUI
|
||||
|
||||
struct HomeScreenRecoveryKeyConfirmationBanner: View {
|
||||
let requiresExtraAccountSetup: Bool
|
||||
var context: HomeScreenViewModel.Context
|
||||
|
||||
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 body: some View {
|
||||
VStack(alignment: .leading, spacing: 16) {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
HStack(spacing: 16) {
|
||||
Text(L10n.confirmRecoveryKeyBannerTitle)
|
||||
Text(title)
|
||||
.font(.compound.bodyLGSemibold)
|
||||
.foregroundColor(.compound.textPrimary)
|
||||
|
||||
@@ -29,12 +34,12 @@ struct HomeScreenRecoveryKeyConfirmationBanner: View {
|
||||
.frame(width: 12, height: 12)
|
||||
}
|
||||
}
|
||||
Text(L10n.confirmRecoveryKeyBannerMessage)
|
||||
Text(message)
|
||||
.font(.compound.bodyMD)
|
||||
.foregroundColor(.compound.textSecondary)
|
||||
}
|
||||
|
||||
Button(L10n.actionContinue) {
|
||||
Button(actionTitle) {
|
||||
context.send(viewAction: .confirmRecoveryKey)
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
@@ -52,7 +57,12 @@ struct HomeScreenRecoveryKeyConfirmationBanner_Previews: PreviewProvider, Testab
|
||||
static let viewModel = buildViewModel()
|
||||
|
||||
static var previews: some View {
|
||||
HomeScreenRecoveryKeyConfirmationBanner(context: viewModel.context)
|
||||
HomeScreenRecoveryKeyConfirmationBanner(requiresExtraAccountSetup: true,
|
||||
context: viewModel.context)
|
||||
.previewDisplayName("Set up recovery")
|
||||
HomeScreenRecoveryKeyConfirmationBanner(requiresExtraAccountSetup: false,
|
||||
context: viewModel.context)
|
||||
.previewDisplayName("Out of sync")
|
||||
}
|
||||
|
||||
static func buildViewModel() -> HomeScreenViewModel {
|
||||
|
||||
-12
@@ -28,18 +28,6 @@ class SecureBackupRecoveryKeyScreenViewModel: SecureBackupRecoveryKeyScreenViewM
|
||||
super.init(initialViewState: .init(isModallyPresented: isModallyPresented,
|
||||
mode: secureBackupController.recoveryState.value.viewMode,
|
||||
bindings: .init()))
|
||||
|
||||
secureBackupController.recoveryState
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink(receiveValue: { [weak self] state in
|
||||
switch state {
|
||||
case .settingUp:
|
||||
self?.showLoadingIndicator()
|
||||
default:
|
||||
self?.hideLoadingIndicator()
|
||||
}
|
||||
})
|
||||
.store(in: &cancellables)
|
||||
}
|
||||
|
||||
// MARK: - Public
|
||||
|
||||
+6
-6
@@ -28,7 +28,7 @@ struct SecureBackupScreen: View {
|
||||
}
|
||||
}
|
||||
.compoundList()
|
||||
.navigationTitle(L10n.commonChatBackup)
|
||||
.navigationTitle(L10n.commonEncryption)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.alert(item: $context.alertInfo)
|
||||
}
|
||||
@@ -68,8 +68,7 @@ struct SecureBackupScreen: View {
|
||||
}
|
||||
|
||||
private var keyStorageToggle: some View {
|
||||
ListRow(label: .plain(title: L10n.screenChatBackupKeyStorageToggleTitle,
|
||||
description: L10n.screenChatBackupKeyStorageToggleDescription),
|
||||
ListRow(label: .plain(title: L10n.screenChatBackupKeyStorageToggleTitle),
|
||||
kind: .toggle($context.keyStorageEnabled))
|
||||
.onChange(of: context.keyStorageEnabled) { _, newValue in
|
||||
context.send(viewAction: .keyStorageToggled(newValue))
|
||||
@@ -86,7 +85,10 @@ struct SecureBackupScreen: View {
|
||||
iconAlignment: .top),
|
||||
kind: .navigationLink { context.send(viewAction: .recoveryKey) })
|
||||
case .disabled:
|
||||
ListRow(label: .plain(title: L10n.screenChatBackupRecoveryActionSetup),
|
||||
ListRow(label: .default(title: L10n.screenChatBackupRecoveryActionSetup,
|
||||
description: L10n.screenChatBackupRecoveryActionChangeDescription,
|
||||
icon: \.key,
|
||||
iconAlignment: .top),
|
||||
details: .icon(BadgeView(size: 10)),
|
||||
kind: .navigationLink { context.send(viewAction: .recoveryKey) })
|
||||
case .incomplete:
|
||||
@@ -105,8 +107,6 @@ struct SecureBackupScreen: View {
|
||||
@ViewBuilder
|
||||
private var recoveryKeySectionFooter: some View {
|
||||
switch context.viewState.recoveryState {
|
||||
case .disabled:
|
||||
Text(L10n.screenChatBackupRecoveryActionSetupDescription(InfoPlistReader.main.bundleDisplayName))
|
||||
case .incomplete:
|
||||
Text(L10n.screenChatBackupRecoveryActionConfirmDescription)
|
||||
default:
|
||||
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:44dd3541075b625b336187423c2ef1fd7330ce3fffb644cf117f12583df4217b
|
||||
size 95942
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a4755216723bde1c66554701adf2fefec3f6a4b2949d66ac5875a801b1cd3d8f
|
||||
size 95958
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e84c622fbb683ac69fa5eb646de5bd340c6105cb08dddd7ab5ecae9d55299583
|
||||
size 101351
|
||||
-3
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:37087b35747692f0ddea27c331644404c9785d6d992fe8c4da46b3a6148d2753
|
||||
size 110582
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2ea3d780c157fc77da9a75f73d8b482f7d23eb539a67e854dba0ba44deda6173
|
||||
size 110663
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:934180921dd8b9c7feeb270fcf3a6d1a2847edba5fc4ea4c820a95b60080c218
|
||||
size 119120
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:aec6cef7b010741b2db19085da28d43c3a1a511a658fa957236d665d5aaf6429
|
||||
size 65400
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:338ad333cedcb48ce8ea5ba3573956f122e9a48fd411249f803b32c8b755a75b
|
||||
size 92631
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:41207583349f9c70c02e9f37482445511c597f46d150f6a2c289f0fd731c580b
|
||||
size 138178
|
||||
oid sha256:05bb5553f7cef20942a10107f5122021954f396a5e7866efdaa1fd6e110df4a1
|
||||
size 131498
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4574b56fd9c50e2146d6675881dd544e00d9f6ca4b8fa30beed4d42160f833f1
|
||||
size 115816
|
||||
oid sha256:248c05bf396932033fdc1f2821659988b6cdde1558c4db1ff2e36c6eef9ae02d
|
||||
size 109322
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0b2432ac9ec6980dfa6618409a401d3a18474c73e37f49b5e29ba3b0dd1d0da0
|
||||
size 134492
|
||||
oid sha256:b6d9b14acdfe5dc08200d630a6cf5a0ae9d2649926b6840ffd50bde4014b7805
|
||||
size 130555
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:00b7edaaa02c2ffcb38f79f31e9f265a4c3a837df76858bd6027742b250ed8fb
|
||||
size 92190
|
||||
oid sha256:ff079b6cd61f2c0fb2c4a7a66dd1cdbc297b9ee0951fad8274b0d279507544ca
|
||||
size 91489
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:53c980680e3a15a67fb5bea95819d42da84dac6c15d346dec0e6e79107a3f3fe
|
||||
size 169146
|
||||
oid sha256:1256574201331ee413d7821b8512fe2e3253849b3f59f25c81ea9c9322380656
|
||||
size 161073
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bc7cb971fef0b09290cd1296b67df22d792634a0f7ff48121e2432e1541ecfff
|
||||
size 133858
|
||||
oid sha256:617075b51396eb2cbaddee74e2673f0b778b04f5f9263c8314dbdde774c6a233
|
||||
size 126840
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b08d094fbf0ca9f671a804a6894659ad9de40f10d376b1903f0449240dd0cf17
|
||||
size 163516
|
||||
oid sha256:abc0a540d895cdc05a132329f4f9893a7be01f60da1035287be8037befe46c6c
|
||||
size 160021
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4471d33581e3ebb69e7c83f87288f9c67267e84845606066db3e3fc88813fa2a
|
||||
size 95297
|
||||
oid sha256:47fe19f5a821b1ef13956f05ea55ec4f9d22ec8846a5596b318eec1cc0974071
|
||||
size 94488
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d297f54924748f5aa9d03852553f953647b2d18437a0e598371796fd006f33f5
|
||||
size 93416
|
||||
oid sha256:c532779ed296a8cc868cde0e0b392ebb55ee385dd1210d1e08aaed591a49f6ce
|
||||
size 89453
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cdef08ee53dcd8b6ba7f599e6264b17ca23add1cc0c824d5bb01ba033223920c
|
||||
size 70563
|
||||
oid sha256:1203fa1008ba94be887f96b286efa557a96577cf30ea0a3f882b9f7576b4c646
|
||||
size 66212
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9cdf64b4ce3eedf3b3c9dc78adecf093d562dd839ff94b34550602592d77f6ad
|
||||
size 89304
|
||||
oid sha256:a7539759e9e9bdfd354ffa771de2c6b733697203b9c11b982890554e14a9bbae
|
||||
size 89693
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:efa3569bb4408168dc0416e65de3c57406505199f92e7b81ffb697242b439a14
|
||||
size 45404
|
||||
oid sha256:fb3b0d4c592e7dd54650f94bcdbf1d3763dd946c7f8c753b024a27d24e3d7cdb
|
||||
size 45210
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:96b19939706086621b14c3b28dc7cc6cff5f92363f241e4efd907cbc82aa1ef1
|
||||
size 145495
|
||||
oid sha256:768a1a253229d73ddf4ce3a26576cc48c252dfcd205bf092eca7779f40d00900
|
||||
size 134673
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d5bfb165c7566fa93c490d775c4d1ce1eed9a78bf78ad2ff7e3029e48684cca1
|
||||
size 99065
|
||||
oid sha256:9199e5915f3292565b67005b242619cf670f07024c7097ab0e7af7bd5bc23710
|
||||
size 89974
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c08b79a27496e4c14e6a20b3dcc986cd4ac028ad9fbc1560ce331b3b03b1f9c6
|
||||
size 135286
|
||||
oid sha256:3e3b703d69dfc4c7a231b32eefe63c3fd6010d84cda71ef9b9fd2b9555a21aa6
|
||||
size 134095
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:db5c48557a3e20b0767a93b92f0f3a72351f7dd1f2ca6d89afb108aac8ff73d2
|
||||
size 53699
|
||||
oid sha256:0709b19f855c68b6c72d16a6377ef96a388ffec5604c2d66492c8602cfa11e90
|
||||
size 53200
|
||||
|
||||
@@ -46,8 +46,8 @@ final class MediaUploadingPreprocessorTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testLandscapeMovVideoProcessing() async {
|
||||
// Allow double the default execution time as we encode the video twice now.
|
||||
executionTimeAllowance = 120
|
||||
// Allow an increased execution time as we encode the video twice now.
|
||||
executionTimeAllowance = 180
|
||||
|
||||
guard let url = Bundle(for: Self.self).url(forResource: "landscape_test_video.mov", withExtension: nil) else {
|
||||
XCTFail("Failed retrieving test asset")
|
||||
@@ -109,8 +109,8 @@ final class MediaUploadingPreprocessorTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testPortraitMp4VideoProcessing() async {
|
||||
// Allow double the default execution time as we encode the video twice now.
|
||||
executionTimeAllowance = 120
|
||||
// Allow an increased execution time as we encode the video twice now.
|
||||
executionTimeAllowance = 180
|
||||
|
||||
guard let url = Bundle(for: Self.self).url(forResource: "portrait_test_video.mp4", withExtension: nil) else {
|
||||
XCTFail("Failed retrieving test asset")
|
||||
|
||||
Reference in New Issue
Block a user