Skip to content

Commit

Permalink
fix: merging issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNumericite committed Nov 28, 2024
1 parent bbc9965 commit 535e744
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 4 additions & 10 deletions webapp/src/components/offer/page/CouponUsedBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ const CouponUsedBox = (props: CouponUsedBoxProps) => {
api.coupon.usedFromUser.useMutation();

const handleCouponUsed = (used: boolean) => {
console.log(used);
if (!used) {
setShowUsedBox(false);
} else {
onOpenCouponUsedFeedbackModal();
}
};

const closeFeedbackModal = () => {
onCloseCouponUsedFeedbackModal();
const confirmUsed = () => {
mutateCouponUsed({ coupon_id: coupon.id });

setTimeout(() => {
setIsSwitched(true);
Expand All @@ -52,11 +51,6 @@ const CouponUsedBox = (props: CouponUsedBoxProps) => {
setTimeout(() => {
confirmCouponUsed();
}, 1000);

// window.open(
// "https://surveys.hotjar.com/8d25a606-6e24-4437-97be-75fcdb4c3e35",
// "_blank"
// );
};

if (!showUsedBox) return;
Expand Down Expand Up @@ -85,8 +79,8 @@ const CouponUsedBox = (props: CouponUsedBoxProps) => {
</FormControl>
<CouponUsedFeedbackModal
isOpen={isOpenCouponUsedFeedbackModal}
onClose={closeFeedbackModal}
onConfirm={() => mutateCouponUsed({ coupon_id: coupon.id })}
onClose={onCloseCouponUsedFeedbackModal}
onConfirm={confirmUsed}
/>
</Flex>
);
Expand Down
6 changes: 6 additions & 0 deletions webapp/src/pages/dashboard/offer/cje/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ export default function OfferCjePage() {
}
}, [router.isReady, isLoadingCoupon]);

useEffect(() => {
if (kind === "offer") {
setCouponErased(false);
}
}, [kind]);

if (isLoadingOffer || !offer || isLoadingCoupon || !router.isReady)
return (
<OfferHeaderWrapper
Expand Down

0 comments on commit 535e744

Please sign in to comment.