From 767d442fe2f6302d97450f9d487485048ea86041 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Sun, 2 Aug 2026 15:50:46 +0530 Subject: [PATCH 1/3] fix: code quality and safety improvements --- website3.0/pages/OTP.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website3.0/pages/OTP.js b/website3.0/pages/OTP.js index ec0e94aa..0e981ec1 100644 --- a/website3.0/pages/OTP.js +++ b/website3.0/pages/OTP.js @@ -22,7 +22,7 @@ const OTP = ({ onClose, onOTPSubmit, onBack ,isError,email,theme,setMsg, setIsPo }; // Handle input change for OTP fields const handleChange = (element, index) => { - if (isNaN(element.value)) return false; + if (Number.isNaN(element.value)) return false; // Update the OTP state setOtp([...otp.map((d, idx) => (idx === index ? element.value : d))]); From 63bd1cb7bea42449af5ad06eb5957ce0cf65ccaf Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Mon, 3 Aug 2026 00:50:10 +0530 Subject: [PATCH 2/3] fix: additional real bug fixes --- website3.0/pages/OTP.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website3.0/pages/OTP.js b/website3.0/pages/OTP.js index 0e981ec1..6d3c1683 100644 --- a/website3.0/pages/OTP.js +++ b/website3.0/pages/OTP.js @@ -9,7 +9,7 @@ const OTP = ({ onClose, onOTPSubmit, onBack ,isError,email,theme,setMsg, setIsPo const handlePaste = (e) => { const pasteData = e.clipboardData.getData('text').slice(0, 6); // Get the pasted data and limit it to 6 characters if (pasteData) { - const newOtp = otp.map((char, idx) => pasteData[idx] || ''); + const newOtp = (otp ?? []).map((char, idx) => pasteData[idx] || ''); setOtp(newOtp); // Move focus to the last filled input From 91af63078de78092a311851b439c5b74f88cd68f Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Mon, 3 Aug 2026 00:51:23 +0530 Subject: [PATCH 3/3] fix: additional real bug fixes --- website3.0/pages/OTP.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website3.0/pages/OTP.js b/website3.0/pages/OTP.js index 6d3c1683..69374a37 100644 --- a/website3.0/pages/OTP.js +++ b/website3.0/pages/OTP.js @@ -25,7 +25,7 @@ const OTP = ({ onClose, onOTPSubmit, onBack ,isError,email,theme,setMsg, setIsPo if (Number.isNaN(element.value)) return false; // Update the OTP state - setOtp([...otp.map((d, idx) => (idx === index ? element.value : d))]); + setOtp([...(otp ?? []).map((d, idx) => (idx === index ? element.value : d))]); // Move focus to the next input field if value is entered if (element.value !== '') {