diff --git a/components/cart/modal.tsx b/components/cart/modal.tsx index 047a22957..25e3ccfd0 100644 --- a/components/cart/modal.tsx +++ b/components/cart/modal.tsx @@ -26,14 +26,14 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) { useEffect(() => { // Open cart modal when when quantity changes. - if (cart && cart.totalQuantity !== quantityRef.current) { + if (cart?.totalQuantity !== quantityRef.current) { // But only if it's not already open (quantity also changes when editing items in cart). if (!isOpen) { setIsOpen(true); } // Always update the quantity reference - quantityRef.current = cart.totalQuantity; + quantityRef.current = cart?.totalQuantity; } }, [isOpen, cart?.totalQuantity, quantityRef]); diff --git a/components/layout/footer-menu.tsx b/components/layout/footer-menu.tsx index caf579bd5..feeeec0b0 100644 --- a/components/layout/footer-menu.tsx +++ b/components/layout/footer-menu.tsx @@ -28,7 +28,7 @@ const FooterMenuItem = ({ item }: { item: Menu }) => { ); }; -export default async function FooterMenu({ menu }: { menu: Menu[] }) { +export default function FooterMenu({ menu }: { menu: Menu[] }) { if (!menu.length) return null; return (