mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-10 20:35:17 +02:00
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:
commit
0a5873cd6a
1 changed files with 5 additions and 2 deletions
|
|
@ -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(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue