mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-21 05:53:36 -07:00
opinionated comment cleanup
This commit is contained in:
parent
7e5924d692
commit
798f5a36cc
4 changed files with 3 additions and 18 deletions
|
@ -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)));
|
||||
});
|
||||
|
||||
|
|
|
@ -77,7 +77,6 @@ export function useShoppingListCrud(
|
|||
refresh();
|
||||
}
|
||||
|
||||
// Individual item operations
|
||||
function saveListItem(item: ShoppingListItemOut) {
|
||||
if (!shoppingList.value) {
|
||||
return;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue