From cc7ee40a88ca95794da07569c54127af2abf61a2 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 11 Dec 2023 11:54:54 +0000 Subject: [PATCH] Allow the recovery section to be shown when recovery is incomplete and key backup is stuck waiting for the secrets --- .../SecureBackupScreen/View/SecureBackupScreen.swift | 12 +++++++++--- .../test_secureBackupScreen.Recovery-incomplete.png | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift index c473dd069..fdf6ea264 100644 --- a/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift +++ b/ElementX/Sources/Screens/SecureBackup/SecureBackupScreen/View/SecureBackupScreen.swift @@ -23,11 +23,17 @@ struct SecureBackupScreen: View { var body: some View { Form { - if context.viewState.keyBackupState == .unknown { - keyBackupSection + // Show recovery options for confirming the recovery key and + // getting access to secrets and implicitly the key backup + if context.viewState.recoveryKeyState == .incomplete { + recoveryKeySection } else { keyBackupSection - recoveryKeySection + + // Don't show recovery options until key backup is enabled + if context.viewState.keyBackupState != .unknown { + recoveryKeySection + } } } .compoundList() diff --git a/UnitTests/__Snapshots__/PreviewTests/test_secureBackupScreen.Recovery-incomplete.png b/UnitTests/__Snapshots__/PreviewTests/test_secureBackupScreen.Recovery-incomplete.png index eedfe2f81..81ff1f365 100644 --- a/UnitTests/__Snapshots__/PreviewTests/test_secureBackupScreen.Recovery-incomplete.png +++ b/UnitTests/__Snapshots__/PreviewTests/test_secureBackupScreen.Recovery-incomplete.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:333cd9be32f2a653d622db63d36697c31913a8bb29a3175a63744d1010aa358c -size 112225 +oid sha256:231e41c1c70660c5038f415569cd547bc620e064440227f5da15f11241186e5b +size 85770