bug fixed
This commit is contained in:
@@ -81,16 +81,18 @@ const ProductDetail = () => {
|
||||
? 0
|
||||
: Number(String(quantity).replace(',', '.'));
|
||||
|
||||
/* ---------------- HELPERS ---------------- */
|
||||
const clampQuantity = (value: number) => {
|
||||
if (isNaN(value)) return MIN_QTY;
|
||||
|
||||
let safe = Math.max(value, MIN_QTY);
|
||||
safe = Math.min(safe);
|
||||
let safe = value;
|
||||
|
||||
if (isGram) {
|
||||
safe = Math.max(value, MIN_QTY);
|
||||
safe = Math.ceil(safe / STEP) * STEP;
|
||||
}
|
||||
|
||||
return safe;
|
||||
};
|
||||
|
||||
const getQuantityMessage = (qty: number, measurement: string | null) => {
|
||||
if (!measurement) return `${qty} dona`;
|
||||
return `${qty} ${measurement}`;
|
||||
|
||||
Reference in New Issue
Block a user