Fix item quantity increase

This commit is contained in:
Nico 2025-11-24 19:15:26 -08:00
parent 57b52b6b50
commit e8c75b1276

View File

@ -72,7 +72,8 @@ export default function GroceryList() {
let newQuantity = quantity;
const item = await getItemByName(itemName);
if (item.data && item.data.item_bought === false) {
if (item.data && item.data.bought === false) {
console.log("Item exists:", item.data);
let currentQuantity = item.data.quantity;
const yes = window.confirm(
`Item "${itemName}" already exists in the list. Do you want to update its quantity from ${currentQuantity} to ${currentQuantity + newQuantity}?`