This commit is contained in:
Manav Rathi 2025-02-25 16:29:34 +05:30
parent cc2be30f53
commit 1c1fe7f1df
No known key found for this signature in database
13 changed files with 16 additions and 18 deletions

View File

@ -71,7 +71,7 @@ export const Verify2FACodeForm: React.FC<Verify2FACodeFormProps> = ({
useEffect(() => {
if (values.otp.length == 6 && !isSubmitting) void submitForm();
}, [values, isSubmitting]);
}, [values, isSubmitting, submitForm]);
return (
<form onSubmit={handleSubmit}>

View File

@ -4,10 +4,7 @@ export default [
...config,
{
rules: {
/* TODO:
* "This rule requires the `strictNullChecks` compiler option to be
* turned on to function correctly"
*/
/* TODO: */
"@typescript-eslint/no-unnecessary-condition": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-explicit-any": "off",
@ -15,8 +12,6 @@ export default [
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-call": "off",
/** TODO: Disabled as we migrate, try to prune these again */
"react-hooks/exhaustive-deps": "off",
},
},
];

View File

@ -27,7 +27,7 @@ const Page: React.FC = () => {
if (!user?.token) {
void router.push("/");
}
}, []);
}, [router]);
return (
<AccountsPageContents>

View File

@ -50,7 +50,7 @@ const Page: React.FC = () => {
} else {
setToken(user.token);
}
}, []);
}, [router]);
const onSubmit: SetPasswordFormProps["callback"] = async (
passphrase,

View File

@ -199,9 +199,10 @@ const Page: React.FC = () => {
}
};
void main();
// TODO: validateSession is a dependency, but add that only after we've
// wrapped items from the callback (like logout) in useCallback too.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
// TODO: ^ validateSession is a dependency, but add that only after we've
// wrapped items from the callback (like logout) in useCallback too.
const getKeyAttributes: VerifyMasterPasswordFormProps["getKeyAttributes"] =
async (kek: string) => {

View File

@ -65,7 +65,7 @@ const Page: React.FC = () => {
setToken(user.token);
setLoading(false);
}
}, []);
}, [router]);
const onSubmit: SetPasswordFormProps["callback"] = async (
passphrase,

View File

@ -20,7 +20,7 @@ const Page: React.FC = () => {
void router.push(PAGES.VERIFY);
}
setLoading(false);
}, []);
}, [router]);
const onSignUp = () => void router.push(PAGES.SIGNUP);

View File

@ -33,7 +33,7 @@ const Page: React.FC = () => {
void saveCredentialsAndNavigateTo(passkeySessionID, response).then(
(slug: string) => router.push(slug),
);
}, []);
}, [router]);
return <LoadingIndicator />;
};

View File

@ -59,7 +59,7 @@ const Page: React.FC = () => {
} else {
setKeyAttributes(keyAttributes);
}
}, []);
}, [router]);
const recover: SingleInputFormProps["callback"] = async (
recoveryKey: string,

View File

@ -20,7 +20,7 @@ const Page: React.FC = () => {
void router.push(PAGES.VERIFY);
}
setLoading(false);
}, []);
}, [router]);
const onLogin = () => void router.push(PAGES.LOGIN);

View File

@ -92,6 +92,8 @@ const Page: React.FC<RecoverPageProps> = ({ twoFactorType }) => {
}
};
void main();
// TODO:
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const recover: SingleInputFormProps["callback"] = async (

View File

@ -40,7 +40,7 @@ const Page: React.FC = () => {
} else {
setSessionID(user.twoFactorSessionID);
}
}, []);
}, [router]);
const handleSubmit = async (otp: string) => {
try {

View File

@ -74,7 +74,7 @@ const Page: React.FC = () => {
}
};
void main();
}, []);
}, [router]);
const onSubmit: SingleInputFormProps["callback"] = async (
ott,