From 7705c3113c1cb8baf24f4ff8113197a2f4dfde12 Mon Sep 17 00:00:00 2001 From: jableader Date: Tue, 29 Jul 2025 09:07:44 +1000 Subject: [PATCH] Improved group matching --- src/components/shopping/CurrentShoppingListPage.vue | 4 ++-- src/components/shopping/ShoppingListItem.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/shopping/CurrentShoppingListPage.vue b/src/components/shopping/CurrentShoppingListPage.vue index db445fe..67dcc53 100644 --- a/src/components/shopping/CurrentShoppingListPage.vue +++ b/src/components/shopping/CurrentShoppingListPage.vue @@ -154,8 +154,8 @@ async function saveShoppingList(outstandingItemGroups) { } const groupsMatch = (a, b) => { - if (a.product != b.product) return false; - if (a.name && a.name === b.name) return true; + if (!!a.product != !!b.product) return false; + if (a.name) return a.name === b.name; return a.product.id === b.product.id; } diff --git a/src/components/shopping/ShoppingListItem.vue b/src/components/shopping/ShoppingListItem.vue index 1415d2e..c2e7442 100644 --- a/src/components/shopping/ShoppingListItem.vue +++ b/src/components/shopping/ShoppingListItem.vue @@ -6,7 +6,7 @@

- {{ shoppingListItemGroup.product.name }} + {{ shoppingListItemGroup.product?.name }} {{ shoppingListItemGroup.name }} ,