auto submit otp
This commit is contained in:
parent
05e90ab4fd
commit
595f4e7976
|
|
@ -203,6 +203,12 @@ const KioskPayment = (props) => {
|
||||||
}
|
}
|
||||||
}, [SessionData.CompId, SessionData.BranchId, SessionData.AppId]);
|
}, [SessionData.CompId, SessionData.BranchId, SessionData.AppId]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (otpInput.every(input => input !== '')) {
|
||||||
|
verifyOtp();
|
||||||
|
}
|
||||||
|
}, [otpInput]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const getPrintData = async () => {
|
const getPrintData = async () => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -1922,6 +1928,8 @@ const KioskPayment = (props) => {
|
||||||
} else {
|
} else {
|
||||||
setMessageType('error');
|
setMessageType('error');
|
||||||
setMessageData('Invalid OTP');
|
setMessageData('Invalid OTP');
|
||||||
|
setOtpInput(['', '', '', '']);
|
||||||
|
setOtpIndex(0);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2185,13 +2193,13 @@ const KioskPayment = (props) => {
|
||||||
|
|
||||||
{/* Buttons */}
|
{/* Buttons */}
|
||||||
<div className="otp-buttons">
|
<div className="otp-buttons">
|
||||||
<button
|
{/* <button
|
||||||
className="verify-btn"
|
className="verify-btn"
|
||||||
disabled={otpInput.join('').length !== 4}
|
disabled={otpInput.join('').length !== 4}
|
||||||
onClick={verifyOtp}
|
onClick={verifyOtp}
|
||||||
>
|
>
|
||||||
Verify
|
Verify
|
||||||
</button>
|
</button> */}
|
||||||
|
|
||||||
<button
|
<button
|
||||||
className="resend-btn"
|
className="resend-btn"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue