Skip to content

Commit

Permalink
fix: set retiring to true when payment is card
Browse files Browse the repository at this point in the history
  • Loading branch information
r41ph committed Nov 13, 2024
1 parent 44eb460 commit 0a9e1d1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions web-marketplace/src/pages/BuyCredits/BuyCredits.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useGetProject } from 'components/templates/ProjectDetails/hooks/useGetP
import { useNavigateToSlug } from 'components/templates/ProjectDetails/hooks/useNavigateToSlug';

import { paymentOptionAtom } from './BuyCredits.atoms';
import { PAYMENT_OPTIONS } from './BuyCredits.constants';
import { BuyCreditsForm } from './BuyCredits.Form';
import { CardDetails } from './BuyCredits.types';
import { getFormModel } from './BuyCredits.utils';
Expand Down Expand Up @@ -77,6 +78,12 @@ export const BuyCredits = () => {
if (confirmationTokenId) summarizePayment(confirmationTokenId);
}, [confirmationTokenId, summarizePayment]);

useEffect(() => {
if (!retiring && paymentOption === PAYMENT_OPTIONS.CARD) {
setRetiring(true);
}
}, [paymentOption, retiring, setRetiring]);

if (noProjectFound) return <NotFoundPage />;

return (
Expand Down

0 comments on commit 0a9e1d1

Please sign in to comment.