fix: TTS only on Rileggi btn; use-all deducts from all locations
Cooking mode TTS: - Removed auto-speak from renderCookingStep() entirely - TTS now fires ONLY when user presses 'Rileggi' (replayCookingTTS) - Timer-expiry TTS unchanged (still speaks when a cooking timer expires) submitUseAll fix: - Changed location from selected-location to '__all__' - 'Usato TUTTO / Finito' means the product is completely consumed; using a specific location could fail with a 404 if the async loadUseInventoryInfo() hadn't yet updated the selector (race condition) - The __all__ path in PHP removes inventory across every location
This commit is contained in:
+3
-3
@@ -4044,7 +4044,7 @@ async function submitUseAll() {
|
|||||||
const result = await api('inventory_use', {}, 'POST', {
|
const result = await api('inventory_use', {}, 'POST', {
|
||||||
product_id: currentProduct.id,
|
product_id: currentProduct.id,
|
||||||
use_all: true,
|
use_all: true,
|
||||||
location: document.getElementById('use-location').value,
|
location: '__all__',
|
||||||
});
|
});
|
||||||
showLoading(false);
|
showLoading(false);
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
@@ -6934,8 +6934,8 @@ function renderCookingStep() {
|
|||||||
// Timer: detect duration in step text and show suggestion
|
// Timer: detect duration in step text and show suggestion
|
||||||
setupCookingTimerSuggestion(cleanStep);
|
setupCookingTimerSuggestion(cleanStep);
|
||||||
|
|
||||||
// Speak step
|
// TTS: only speak when explicitly requested via "Rileggi" button
|
||||||
if (_cookingTTS) speakCookingStep(cleanStep);
|
// (auto-speak removed — use replayCookingTTS() to trigger manually)
|
||||||
}
|
}
|
||||||
|
|
||||||
function _buildTtsRequest(text, s) {
|
function _buildTtsRequest(text, s) {
|
||||||
|
|||||||
Reference in New Issue
Block a user