diff --git a/frontend/composables/shopping-list-page/sub-composables/use-shopping-list-copy.ts b/frontend/composables/shopping-list-page/sub-composables/use-shopping-list-copy.ts index 92e10cf7a..f4f87c235 100644 --- a/frontend/composables/shopping-list-page/sub-composables/use-shopping-list-copy.ts +++ b/frontend/composables/shopping-list-page/sub-composables/use-shopping-list-copy.ts @@ -11,18 +11,12 @@ export function useShoppingListCopy() { function copyListItems(itemsByLabel: { [key: string]: ShoppingListItemOut[] }, copyType: CopyTypes) { const text: string[] = []; - - // Copy text into subsections based on label Object.entries(itemsByLabel).forEach(([label, items], idx) => { - // for every group except the first, add a blank line if (idx) { text.push(""); } - // add an appropriate heading for the label depending on the copy format text.push(formatCopiedLabelHeading(copyType, label)); - - // now add the appropriately formatted list items with the given label items.forEach(item => text.push(formatCopiedListItem(copyType, item))); }); diff --git a/frontend/composables/shopping-list-page/sub-composables/use-shopping-list-crud.ts b/frontend/composables/shopping-list-page/sub-composables/use-shopping-list-crud.ts index 481ee1b13..cbdacadbb 100644 --- a/frontend/composables/shopping-list-page/sub-composables/use-shopping-list-crud.ts +++ b/frontend/composables/shopping-list-page/sub-composables/use-shopping-list-crud.ts @@ -77,7 +77,6 @@ export function useShoppingListCrud( refresh(); } - // Individual item operations function saveListItem(item: ShoppingListItemOut) { if (!shoppingList.value) { return; diff --git a/frontend/composables/shopping-list-page/use-shopping-list-page.ts b/frontend/composables/shopping-list-page/use-shopping-list-page.ts index 106e94372..e482dfa76 100644 --- a/frontend/composables/shopping-list-page/use-shopping-list-page.ts +++ b/frontend/composables/shopping-list-page/use-shopping-list-page.ts @@ -52,7 +52,7 @@ export function useShoppingListPage(listId: string) { const refresh = () => baseRefresh(updateListItemOrder); - // Initialize labels + // Initialize shopping list labels const labels = useShoppingListLabels(shoppingList); // Initialize copy functionality @@ -164,8 +164,6 @@ export function useShoppingListPage(listId: string) { }); return { - // State - flatten the dialog state for easier access - ...state.state, shoppingList, loadingCounter, recipeReferenceLoading, @@ -179,13 +177,10 @@ export function useShoppingListPage(listId: string) { itemsByLabel, isOffline, - // Labels + // Sub-composables + ...state.state, ...labels, - - // CRUD operations ...crud, - - // Recipe management ...recipes, // Specialized functions diff --git a/frontend/pages/shopping-lists/[id].vue b/frontend/pages/shopping-lists/[id].vue index ee8be924c..3237004d9 100644 --- a/frontend/pages/shopping-lists/[id].vue +++ b/frontend/pages/shopping-lists/[id].vue @@ -398,10 +398,7 @@ export default defineNuxtComponent({ const groupSlug = computed(() => route.params.groupSlug as string || $auth.user.value?.groupSlug || ""); const id = route.params.id as string; - // Use the main shopping list page composable const shoppingListPage = useShoppingListPage(id); - - // Get stores for labels, units, and foods const { store: allLabels } = useLabelStore(); const { store: allUnits } = useUnitStore(); const { store: allFoods } = useFoodStore();