fix: cart delete mutation and console warnings
Some checks failed
Build and Deploy / build (push) Has been cancelled

- Fix checkoutLinesDelete mutation: use 'id' param and 'linesIds' instead of 'lineIds'
- Fix viewport metadata warning: move to separate viewport export in layout.tsx
- Add sizes prop to checkout Image with fill
- Fix CartDrawer init checkout useEffect to prevent re-render loops
- Various product detail improvements
This commit is contained in:
Unchained
2026-03-23 13:49:14 +02:00
parent 7f603c83e9
commit ace1ac104e
8 changed files with 95 additions and 20 deletions

View File

@@ -1,6 +1,6 @@
"use client";
import { useEffect } from "react";
import { useEffect, useState } from "react";
import { motion, AnimatePresence } from "framer-motion";
import Image from "next/image";
import Link from "next/link";
@@ -27,11 +27,15 @@ export default function CartDrawer() {
const lines = getLines();
const total = getTotal();
const lineCount = getLineCount();
const [initialized, setInitialized] = useState(false);
// Initialize checkout on mount
// Initialize checkout on mount (only once)
useEffect(() => {
initCheckout();
}, [initCheckout]);
if (!initialized) {
initCheckout();
setInitialized(true);
}
}, [initialized]);
// Lock body scroll when cart is open
useEffect(() => {