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 authored and blushi committed Nov 25, 2024
1 parent af8ba95 commit f111271
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 f111271

Please sign in to comment.