Skip to content

Commit

Permalink
error solved
Browse files Browse the repository at this point in the history
  • Loading branch information
sinanptm committed Aug 31, 2024
1 parent be3886d commit eb9c086
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions client/app/(patient)/signin/otp-verification/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,17 @@ const OtpVerificationPage = () => {
const [isLoading, setLoading] = useState(true);
const { patientToken } = useAuth();

if (otpMail && !patientToken) {
useEffect(() => {
const timer = setTimeout(() => {
setLoading(false);
}, 0);

return () => clearTimeout(timer);
}, []);

if (isLoading) {
<UniversalSkelton />;
}
useEffect(() => {
const timer = setTimeout(() => {
setLoading(false);
}, 0);

return () => clearTimeout(timer);
}, []);
if (isLoading) {
return <UniversalSkelton />;
}
if (otpMail && !patientToken) {
const handleVerify = async (e: FormEvent) => {
e.preventDefault();
validateOtp(
Expand All @@ -49,11 +47,10 @@ const OtpVerificationPage = () => {
</Button>
),
});
navigate.push("/");
setTimeout(() => {
setCredentials("patientToken", accessToken);
navigate.push("/");
}, 200);
setCredentials("otpMail", "");
},
onError: (error) => {
toast({
Expand Down Expand Up @@ -93,8 +90,9 @@ const OtpVerificationPage = () => {
<Image src={Banners.otp} height={1000} width={1000} alt="patient" className="side-img max-w-[50%]" />
</div>
);
}else{
notFound();
}
notFound();
};

export default OtpVerificationPage;

1 comment on commit eb9c086

@vercel
Copy link

@vercel vercel bot commented on eb9c086 Aug 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.