fix(scale): revert autofill min to 10g; keep 2g only for stability filter and live box
This commit is contained in:
+8
-8
@@ -476,14 +476,14 @@ function _scaleAutoFillUse(msg) {
|
|||||||
else if (srcUnit === 'ml') { grams = rawVal; scaleAlreadyMl = true; }
|
else if (srcUnit === 'ml') { grams = rawVal; scaleAlreadyMl = true; }
|
||||||
else grams = rawVal;
|
else grams = rawVal;
|
||||||
|
|
||||||
// Reject if raw grams < 2 (tara / rumore)
|
// Reject if raw grams < 10 (piatto vuoto / tara / rumore)
|
||||||
if (grams < 2) {
|
if (grams < 10) {
|
||||||
_cancelScaleStabilityWait(); // stop bar only; keep sentinel & userDismissed
|
_cancelScaleStabilityWait(); // stop bar only; keep sentinel & userDismissed
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reject if weight hasn't changed enough from last confirmed reading (same product still on scale)
|
// Reject if weight hasn't changed enough from last confirmed reading (same product still on scale)
|
||||||
if (_scaleLastConfirmedGrams !== null && Math.abs(grams - _scaleLastConfirmedGrams) < 2) {
|
if (_scaleLastConfirmedGrams !== null && Math.abs(grams - _scaleLastConfirmedGrams) < 10) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,8 +508,8 @@ function _scaleAutoFillUse(msg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reject if converted value < 2 (density edge case)
|
// Reject if converted value < 10 (density edge case)
|
||||||
if (val < 2) {
|
if (val < 10) {
|
||||||
_scaleUserDismissed = false;
|
_scaleUserDismissed = false;
|
||||||
_cancelScaleTimersOnly();
|
_cancelScaleTimersOnly();
|
||||||
_startScaleStabilityWait(() => {
|
_startScaleStabilityWait(() => {
|
||||||
@@ -612,15 +612,15 @@ function _scaleAutoFillRecipeUse(msg) {
|
|||||||
hint.style.display = '';
|
hint.style.display = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val < 2) {
|
if (val < 10) {
|
||||||
_cancelScaleStabilityWait(); // stop bar only; keep sentinel
|
_cancelScaleStabilityWait(); // stop bar only; keep sentinel
|
||||||
if (livLabel) livLabel.textContent = t('scale.weight_too_low');
|
if (livLabel) livLabel.textContent = t('scale.weight_too_low');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reject if weight hasn't changed enough from last confirmed reading.
|
// Reject if weight hasn't changed enough from last confirmed reading.
|
||||||
// Threshold: 2g — noise filter.
|
// Threshold: 5g — gives enough time to tare after opening the modal.
|
||||||
if (_scaleLastConfirmedGrams !== null && Math.abs(grams - _scaleLastConfirmedGrams) < 2) {
|
if (_scaleLastConfirmedGrams !== null && Math.abs(grams - _scaleLastConfirmedGrams) < 5) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user