Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(react/settings): add back some checks for MFA
Elian Doran018a6cb84abd
diff --git a/apps/client/src/widgets/type_widgets/options/multi_factor_authentication.tsx b/apps/client/src/widgets/type_widgets/options/multi_factor_authentication.tsxindex efbc0d9722..bebb51eca9 100644--- a/apps/client/src/widgets/type_widgets/options/multi_factor_authentication.tsx+++ b/apps/client/src/widgets/type_widgets/options/multi_factor_authentication.tsx@@ -14,15 +14,20 @@ import Button from "../../react/Button"import dialog from "../../../services/dialog"import toast from "../../../services/toast"import RawHtml from "../../react/RawHtml"+import { isElectron } from "../../../services/utils"export default function MultiFactorAuthenticationSettings() {const [ mfaEnabled, setMfaEnabled ] = useTriliumOptionBool("mfaEnabled");- return (- <>- <EnableMultiFactor mfaEnabled={mfaEnabled} setMfaEnabled={setMfaEnabled} />- <MultiFactorMethod />- </>+ return (!isElectron()+ ? (+ <>+ <EnableMultiFactor mfaEnabled={mfaEnabled} setMfaEnabled={setMfaEnabled} />+ { mfaEnabled && <MultiFactorMethod /> }+ </>+ ) : (+ <FormText>{t("multi_factor_authentication.electron_disabled")}</FormText>+ ))}@@ -70,14 +75,6 @@ function MultiFactorMethod() {}function TotpSettings() {- return (- <div class="totp-options">- <TotpGenerateSecret />- </div>- );-}--function TotpGenerateSecret() {const [ totpStatus, setTotpStatus ] = useState<TOTPStatus>();const [ recoveryKeys, setRecoveryKeys ] = useState<string[]>();