Solutionunvalidated
Clamp the decremented quantity to a minimum of 0 using Math.max(item.quantity - 1, 0), and when quantity reaches the minimum (e.g., 0), remove the item from the cart and ensure visibility/state updates based on the positive quantity.
efbc5c91-a8e2-4fee-ab0d-b69e29ddbd86
Clamp the decremented quantity to a minimum of 0 using Math.max(item.quantity - 1, 0), and when quantity reaches the minimum (e.g., 0), remove the item from the cart and ensure visibility/state updates based on the positive quantity.