File tree Expand file tree Collapse file tree
features/bookings/Booker/components/hooks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export const useVerifyEmail = ({
2323 const [ isEmailVerificationModalVisible , setEmailVerificationModalVisible ] = useState ( false ) ;
2424 const verifiedEmail = useBookerStore ( ( state ) => state . verifiedEmail ) ;
2525 const setVerifiedEmail = useBookerStore ( ( state ) => state . setVerifiedEmail ) ;
26+ const isRescheduling = useBookerStore ( ( state ) => Boolean ( state . rescheduleUid && state . bookingData ) ) ;
2627 const debouncedEmail = useDebounce ( email , 600 ) ;
2728 const { data : session } = useSession ( ) ;
2829
@@ -44,7 +45,7 @@ export const useVerifyEmail = ({
4445 email : debouncedEmail ,
4546 } ,
4647 {
47- enabled : ! ! debouncedEmail ,
48+ enabled : ! ! debouncedEmail && ! isRescheduling ,
4849 }
4950 ) ;
5051
@@ -60,6 +61,7 @@ export const useVerifyEmail = ({
6061 const isVerificationCodeSending = sendEmailVerificationByCodeMutation . isPending ;
6162
6263 const renderConfirmNotVerifyEmailButtonCond =
64+ isRescheduling ||
6365 ( ! requiresBookerEmailVerification && ! isEmailVerificationRequired ) ||
6466 ( email && verifiedEmail && verifiedEmail === email ) ;
6567
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export const useVerifyEmail = ({
3333 const [ isEmailVerificationModalVisible , setEmailVerificationModalVisible ] = useState ( false ) ;
3434 const verifiedEmail = useBookerStore ( ( state ) => state . verifiedEmail ) ;
3535 const setVerifiedEmail = useBookerStore ( ( state ) => state . setVerifiedEmail ) ;
36+ const isRescheduling = useBookerStore ( ( state ) => Boolean ( state . rescheduleUid && state . bookingData ) ) ;
3637 const debouncedEmail = useDebounce ( email , 600 ) ;
3738 const { data : user } = useMe ( ) ;
3839
@@ -53,7 +54,7 @@ export const useVerifyEmail = ({
5354 throw new Error ( res . data . error . message ) ;
5455 } ) ;
5556 } ,
56- enabled : ! ! debouncedEmail ,
57+ enabled : ! ! debouncedEmail && ! isRescheduling ,
5758 } ) ;
5859
5960 const sendEmailVerificationMutation = useMutation <
@@ -90,6 +91,7 @@ export const useVerifyEmail = ({
9091 const isVerificationCodeSending = sendEmailVerificationMutation . isPending ;
9192
9293 const renderConfirmNotVerifyEmailButtonCond =
94+ isRescheduling ||
9395 ( ! requiresBookerEmailVerification && ! isEmailVerificationRequired ) ||
9496 ( email && verifiedEmail && verifiedEmail === email ) ;
9597
You can’t perform that action at this time.
0 commit comments