Skip to content

Commit 2cb65f0

Browse files
committed
fix: resolve cart errors
1 parent 4747661 commit 2cb65f0

File tree

1 file changed

+6
-5
lines changed
  • src/app/[locale]/(main)/(container)/cart

1 file changed

+6
-5
lines changed

src/app/[locale]/(main)/(container)/cart/page.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import OutOfStock from '@/components/common/OutOfStock';
66
import PriceLabel from '@/components/common/PriceLabel';
77
import { getFragmentData } from '@/graphql/types';
88
import {
9-
CartContentFragmentDoc,
109
CartItemContentFragmentDoc,
1110
ProductContentSliceFragmentDoc,
1211
ProductVariationContentSliceFragmentDoc,
@@ -27,17 +26,19 @@ import {
2726
} from '@mui/material';
2827
import { useTranslations } from 'next-intl';
2928

29+
import { cartAtom } from '@/store/atoms';
30+
import { useAtomValue } from 'jotai';
31+
import CartItemsSkeleton from './components/CartItemsSkeleton';
3032
import CheckoutBox from './components/CheckoutBox';
33+
import CheckoutBoxSkeleton from './components/CheckoutBoxSkeleton';
3134
import EmptyCart from './components/EmptyCart';
3235
import Header from './components/Header';
33-
import CheckoutBoxSkeleton from './components/CheckoutBoxSkeleton';
34-
import CartItemsSkeleton from './components/CartItemsSkeleton';
3536

3637
const Page = () => {
3738
const t = useTranslations();
38-
const { loading, data } = useCartQuery();
39+
const { loading } = useCartQuery();
3940

40-
const content = getFragmentData(CartContentFragmentDoc, data?.cart);
41+
const content = useAtomValue(cartAtom);
4142

4243
if (!loading && !content?.contents?.itemCount) return <EmptyCart />;
4344

0 commit comments

Comments
 (0)