From 4fd458075c64f55634b895004b580fc0452c3908 Mon Sep 17 00:00:00 2001 From: Samandar Turgunboyev Date: Wed, 25 Feb 2026 11:16:40 +0500 Subject: [PATCH] fixed --- src/features/product/ui/Product.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/features/product/ui/Product.tsx b/src/features/product/ui/Product.tsx index 925e082..01c9224 100644 --- a/src/features/product/ui/Product.tsx +++ b/src/features/product/ui/Product.tsx @@ -199,12 +199,12 @@ const ProductDetail = () => { const handleDecrease = () => { setQuantity((q) => { - const base = q === '' || q === '.' || q === ',' ? 0 : Number(q); + const base = q === '' || q === '.' || q === ',' ? MIN_QTY : Number(q); let next = base - STEP; if (isGram) next = Math.floor(next / STEP) * STEP; - return next <= MIN_QTY ? MIN_QTY : next; + return Math.max(next, MIN_QTY); }); }; @@ -256,7 +256,8 @@ const ProductDetail = () => {