fixed checking food always works

This commit is contained in:
vabene1111
2023-12-23 08:46:42 +01:00
parent d1c4e51842
commit ae3818611d
2 changed files with 12 additions and 10 deletions

View File

@@ -115,14 +115,14 @@ export const useShoppingListStore = defineStore(_STORE_ID, {
}
Vue.set(this.category_food_entries[category]['foods'][entry.food.id]['entries'], entry.id, entry)
},
toggleFoodCheckedState(food) {
setFoodCheckedState(food, checked) {
/**
* function to handle user checking or unchecking a food
*/
let entries = this.category_food_entries[this.getFoodCategory(food)]['foods'][food.id]['entries']
for (let i in entries) {
entries[i].checked = !entries[i].checked
entries[i].checked = checked
this.updateObject(entries[i])
}
},