chore(react/settings): add back some checks for MFA

This commit is contained in:
Elian Doran 2025-08-19 10:54:02 +03:00
parent 44825af0c0
commit 018a6cb84a
No known key found for this signature in database

View File

@ -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 (
return (!isElectron()
? (
<>
<EnableMultiFactor mfaEnabled={mfaEnabled} setMfaEnabled={setMfaEnabled} />
<MultiFactorMethod />
{ 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[]>();