Skip to content

Commit

Permalink
fix(storefront): Fix item quantitymin-max on next tick (9ms)
Browse files Browse the repository at this point in the history
  • Loading branch information
leomp12 committed Mar 9, 2024
1 parent 2822178 commit 6a003e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/storefront/src/lib/state/shopping-cart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,13 @@ watch(shoppingCart.items, (items) => {
|| Number.isNaN(item.quantity)
|| item.quantity < min
) {
item.quantity = min;
setTimeout(() => {
item.quantity = min;
}, 9);
} else if (max && item.quantity > max) {
item.quantity = max;
setTimeout(() => {
item.quantity = max;
}, 9);
}
});
shoppingCart.subtotal = items.reduce((acc, item) => {
Expand Down

0 comments on commit 6a003e7

Please sign in to comment.