Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix the double submit bug

Manav Rathi620853190277
diff --git a/web/packages/accounts/components/Verify2FACodeForm.tsx b/web/packages/accounts/components/Verify2FACodeForm.tsx
index a8c52d6f80..c11e3872d6 100644
--- a/web/packages/accounts/components/Verify2FACodeForm.tsx
+++ b/web/packages/accounts/components/Verify2FACodeForm.tsx
@@ -79,8 +79,8 @@ export const Verify2FACodeForm: React.FC<Verify2FACodeFormProps> = ({
// }
// };
useEffect(() => {
- if (values.otp.length == 6) void submitForm();
- }, [values]);
+ if (values.otp.length == 6 && !isSubmitting) void submitForm();
+ }, [values, isSubmitting]);
return (
<form onSubmit={handleSubmit}>