epicmerch-mcp 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -39,8 +39,7 @@ export default function Cart({ onCheckout }) {
|
|
|
39
39
|
|
|
40
40
|
const remove = async (productId) => {
|
|
41
41
|
await store.cart.remove(productId);
|
|
42
|
-
|
|
43
|
-
setCart(c => ({ ...c, items: (c.items || []).filter(i => i.productId !== productId) }));
|
|
42
|
+
store.cart.get().then(setCart);
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
const total = cart.items?.reduce((s, i) => s + i.price * i.qty, 0) ?? 0;
|
package/src/tools/scaffold.js
CHANGED
|
@@ -124,8 +124,8 @@ export default function Cart({ onCheckout }) {
|
|
|
124
124
|
|
|
125
125
|
const remove = async (productId) => {
|
|
126
126
|
await store.cart.remove(productId);
|
|
127
|
-
// Optimistic local update —
|
|
128
|
-
//
|
|
127
|
+
// Optimistic local update — the client already knows which item was
|
|
128
|
+
// removed; no need for a round-trip to re-fetch the whole cart.
|
|
129
129
|
setCart(c => ({ ...c, items: (c.items || []).filter(i => i.productId !== productId) }));
|
|
130
130
|
};
|
|
131
131
|
|