Merge pull request #976 from LikiosSedo/fix/stale-event-register-retry

fix: avoid stale event reference in register page retry action
This commit is contained in:
Rohan Verma 2026-03-25 12:52:10 -07:00 committed by GitHub
commit 0a5873cd6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,9 +43,12 @@ export default function RegisterPage() {
}
}, [router]);
const handleSubmit = async (e: React.FormEvent) => {
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
submitForm();
};
const submitForm = async () => {
// Form validation
if (password !== confirmPassword) {
setError({ title: t("password_mismatch"), message: t("passwords_no_match_desc") });
@ -140,7 +143,7 @@ export default function RegisterPage() {
if (shouldRetry(errorCode)) {
toastOptions.action = {
label: tCommon("retry"),
onClick: () => handleSubmit(e),
onClick: () => submitForm(),
};
}