mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 14:06:59 +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(() => {
|
||||
// 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]);
|
||||
|
||||
|
@ -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 (
|
||||
|
Loading…
x
Reference in New Issue
Block a user