20260317e: Persist recipe ingredient used state to DB
This commit is contained in:
@@ -4986,6 +4986,7 @@ async function loadRecipeArchive() {
|
||||
function viewArchivedRecipe(idx) {
|
||||
const entry = _recipeArchiveEntries[idx];
|
||||
if (!entry) return;
|
||||
_cachedRecipe = { meal: entry.meal, recipe: entry.recipe };
|
||||
renderRecipe(entry.recipe);
|
||||
document.getElementById('recipe-overlay').style.display = 'flex';
|
||||
document.getElementById('recipe-ask').style.display = 'none';
|
||||
@@ -5262,6 +5263,8 @@ async function submitRecipeUse(useAll) {
|
||||
|
||||
if (_cachedRecipe && _cachedRecipe.recipe && _cachedRecipe.recipe.ingredients && _cachedRecipe.recipe.ingredients[idx]) {
|
||||
_cachedRecipe.recipe.ingredients[idx].used = true;
|
||||
// Persist used state to DB
|
||||
saveRecipeToArchive(_cachedRecipe.recipe);
|
||||
}
|
||||
|
||||
showToast('📦 Ingrediente scalato dalla dispensa!', 'success');
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@
|
||||
<title>Dispensa Manager</title>
|
||||
<link rel="manifest" href="manifest.json">
|
||||
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🏠</text></svg>">
|
||||
<link rel="stylesheet" href="assets/css/style.css?v=20260317d">
|
||||
<link rel="stylesheet" href="assets/css/style.css?v=20260317e">
|
||||
<!-- QuaggaJS for barcode scanning -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/@ericblade/quagga2@1.8.4/dist/quagga.min.js"></script>
|
||||
</head>
|
||||
@@ -911,6 +911,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="assets/js/app.js?v=20260317d"></script>
|
||||
<script src="assets/js/app.js?v=20260317e"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user