diff options
| author | Rafi Zadanly <rafizadanly@gmail.com> | 2022-12-19 17:13:41 +0700 |
|---|---|---|
| committer | Rafi Zadanly <rafizadanly@gmail.com> | 2022-12-19 17:13:41 +0700 |
| commit | 03adcb9bff8cb4a2ffcb442f6e8f787ea205feb4 (patch) | |
| tree | 72d469c10a24c9797099581e186921c8cca2955b /src/pages/shop/cart.js | |
| parent | b17c4ea8bea0b57a2defbfcf327176a874ec1aed (diff) | |
loading not stop when cart is empty, fix input quantity
Diffstat (limited to 'src/pages/shop/cart.js')
| -rw-r--r-- | src/pages/shop/cart.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pages/shop/cart.js b/src/pages/shop/cart.js index 90059d9a..4c954960 100644 --- a/src/pages/shop/cart.js +++ b/src/pages/shop/cart.js @@ -60,8 +60,8 @@ export default function Cart({ previousRoute }) { to_process: false })); setProducts(dataProducts); - setIsLoadingProducts(false); } + setIsLoadingProducts(false); } useEffect(() => { @@ -98,6 +98,10 @@ export default function Cart({ previousRoute }) { const blurQuantity = (productId, quantity) => { quantity = quantity == ('' || 0) ? 1 : parseInt(quantity); + if (typeof quantity === 'number') { + quantity = parseInt(quantity); + quantity = Math.floor(quantity); + } updateCart(productId, quantity); }; |
