mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 22:16:58 +00:00
Fixes lint
This commit is contained in:
parent
c2ff3a0f87
commit
72dad2a914
@ -26,14 +26,14 @@ export default function CartModal({ cart }: { cart: Cart | undefined }) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Open cart modal when when quantity changes.
|
// 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).
|
// But only if it's not already open (quantity also changes when editing items in cart).
|
||||||
if (!isOpen) {
|
if (!isOpen) {
|
||||||
setIsOpen(true);
|
setIsOpen(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always update the quantity reference
|
// Always update the quantity reference
|
||||||
quantityRef.current = cart.totalQuantity;
|
quantityRef.current = cart?.totalQuantity;
|
||||||
}
|
}
|
||||||
}, [isOpen, cart?.totalQuantity, quantityRef]);
|
}, [isOpen, cart?.totalQuantity, quantityRef]);
|
||||||
|
|
||||||
|
@ -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;
|
if (!menu.length) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user