Fix adding non-existent item

This commit is contained in:
Nico 2025-11-23 09:03:07 -08:00
parent f30474cb5d
commit f4e784b2ec

View File

@ -72,7 +72,7 @@ export default function GroceryList() {
let newQuantity = quantity;
const item = await getItemByName(itemName);
if (item) {
if (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}?`