From 8139baacce137694c56c24bfbab78db4c0efa539 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Thu, 30 Jul 2026 19:02:07 +0530 Subject: [PATCH] fix: improve error handling --- src/pages/Contact/Contact.tsx | 86 +---------------------------------- 1 file changed, 1 insertion(+), 85 deletions(-) diff --git a/src/pages/Contact/Contact.tsx b/src/pages/Contact/Contact.tsx index a43652f..93f87d1 100644 --- a/src/pages/Contact/Contact.tsx +++ b/src/pages/Contact/Contact.tsx @@ -21,88 +21,4 @@ function Contact() { e.preventDefault() await emailjs.send(import.meta.env.VITE_EMAILJS_SERVICE_ID!, import.meta.env.VITE_EMAILJS_TEMPLATE_ID!, formDetails, import.meta.env.VITE_EMAILJS_PUBLIC_KEY) .then(function (response) { - if (response) { - alert("Successfully sent the message.") - } - }, function (error) { - if (error) { - alert("Failed to send the message. Err: " + error) - } - }); - setFormDetails({ name: '', email: '', message: '', 'g-recaptcha-response': '' }) - setSendStatus(false) - } - - useEffect(() => { - window.scrollTo(0, 0); - }, []); - return ( - <> - -

- Still not answered, kindly contact us through the contact form below. -

-
-
-
- -

- Need to get in touch with us? Just fill out the form with your - inquiry! -

-
- - - - -
-
- - ); -} - -export default Contact; + .catch(err => console.error(err)) \ No newline at end of file