From 25f8fe200993b08b5e8de3e05a464379aea2880d Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 7 Feb 2025 10:26:17 +0100 Subject: [PATCH] Add missing doc & merge loading states --- .../settings/tabs/user/EncryptionUserSettingsTab.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx b/src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx index 4e490c879d..472e35c8b6 100644 --- a/src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx +++ b/src/components/views/settings/tabs/user/EncryptionUserSettingsTab.tsx @@ -40,8 +40,9 @@ import { DeleteKeyStoragePanel } from "../../encryption/DeleteKeyStoragePanel"; * This happens when the user doesn't have a key a recovery key and the user clicks on "Set up recovery key" button of the RecoveryPanel. * - "reset_identity_compromised": The panel to show when the user is resetting their identity, in te case where their key is compromised. * - "reset_identity_forgot": The panel to show when the user is resetting their identity, in the case where they forgot their recovery key. - * - `secrets_not_cached`: The secrets are not cached locally. This can happen if we verified another device and secret-gossiping failed, or the other device itself lacked the secrets. + * - "secrets_not_cached": The secrets are not cached locally. This can happen if we verified another device and secret-gossiping failed, or the other device itself lacked the secrets. * If the "set_up_encryption" and "secrets_not_cached" conditions are both filled, "set_up_encryption" prevails. + * - "key_storage_delete": The confirmation page asking if the user realy wants to turn off key storage */ export type State = | "loading" @@ -101,13 +102,10 @@ export function EncryptionUserSettingsTab({ initialState = "loading" }: Encrypti const keyBackupIsEnabled = useKeyBackupIsEnabled(); let content: JSX.Element; - if (keyBackupIsEnabled === undefined) { - content = ; + if (keyBackupIsEnabled === undefined || state === "loading") { + content = ; } else { switch (state) { - case "loading": - content = ; - break; case "set_up_encryption": content = ; break;