This commit is contained in:
2025-10-20 21:24:03 +08:00
parent 2e4d39be6d
commit 48ec0d9fb4
3 changed files with 15 additions and 13 deletions

View File

@@ -32,7 +32,7 @@ export default function PasskeyLoginButton({ autoComplete, ...rest }: PasskeyLog
window.PublicKeyCredential &&
PublicKeyCredential.isConditionalMediationAvailable
) {
PublicKeyCredential.isConditionalMediationAvailable().then((v) => {
PublicKeyCredential.isConditionalMediationAvailable().then(() => {
if (!abortRef.current.signal.aborted) startLogin(true)();
});
}
@@ -43,12 +43,7 @@ export default function PasskeyLoginButton({ autoComplete, ...rest }: PasskeyLog
const startLogin = (conditional: boolean) => async () => {
if (!navigator.credentials || !window.PublicKeyCredential) {
enqueueSnackbar({
message: t("setting.browserNotSupported"),
variant: "warning",
action: DefaultCloseAction,
});
enqueueSnackbar(t("setting.browserNotSupported"), { variant: "error", action: DefaultCloseAction });
return;
}

View File

@@ -37,12 +37,7 @@ const PasskeyList = (props: PasskeyProps) => {
const [deleteLoading, setDeleteLoading] = useState(false);
const addPasskey = async () => {
if (!navigator.credentials || !window.PublicKeyCredential) {
enqueueSnackbar({
message: t("setting.browserNotSupported"),
variant: "warning",
action: DefaultCloseAction,
});
dispatch(confirmOperation(t("setting.browserNotSupported")));
return;
}