diff --git a/frontend/components/Layout/DefaultLayout.vue b/frontend/components/Layout/DefaultLayout.vue index b5e5d23a8..883afeb05 100644 --- a/frontend/components/Layout/DefaultLayout.vue +++ b/frontend/components/Layout/DefaultLayout.vue @@ -139,7 +139,7 @@ export default defineNuxtComponent({ const loggedInCookbooks = useCookbooks(); const publicCookbooks = usePublicCookbooks(groupSlug.value || ""); const cookbooks = computed(() => - isOwnGroup.value ? loggedInCookbooks.cookbooks.value : publicCookbooks.cookbooks.value + isOwnGroup.value ? loggedInCookbooks.cookbooks.value : publicCookbooks.cookbooks.value, ); const cookbookPreferences = useCookbookPreferences(); @@ -199,7 +199,8 @@ export default defineNuxtComponent({ } if (cookbooks[0].householdId === currentUserHouseholdId.value) { ownLinks.push(...cookbooks.map(cookbookAsLink)); - } else { + } + else { links.push({ key: householdName, icon: $globals.icons.book, @@ -213,7 +214,8 @@ export default defineNuxtComponent({ links.sort((a, b) => a.title.localeCompare(b.title)); if ($auth.user.value && cookbookPreferences.value.hideOtherHouseholds) { return ownLinks; - } else { + } + else { return [...ownLinks, ...links]; } }); diff --git a/frontend/composables/use-shopping-list-item-actions.ts b/frontend/composables/use-shopping-list-item-actions.ts index 987b02b13..b3fc207a0 100644 --- a/frontend/composables/use-shopping-list-item-actions.ts +++ b/frontend/composables/use-shopping-list-item-actions.ts @@ -93,20 +93,21 @@ export function useShoppingListItemActions(shoppingListId: string) { function mergeListItemsByLatest( list1: ShoppingListItemOut[], - list2: ShoppingListItemOut[] + list2: ShoppingListItemOut[], ) { const mergedList = [...list1]; list2.forEach((list2Item) => { - const conflictingItem = mergedList.find((item) => item.id === list2Item.id) - if (conflictingItem && - list2Item.updatedAt && conflictingItem.updatedAt && - list2Item.updatedAt > conflictingItem.updatedAt) { - mergedList.splice(mergedList.indexOf(conflictingItem), 1, list2Item) - } else if (!conflictingItem) { - mergedList.push(list2Item) + const conflictingItem = mergedList.find(item => item.id === list2Item.id); + if (conflictingItem + && list2Item.updatedAt && conflictingItem.updatedAt + && list2Item.updatedAt > conflictingItem.updatedAt) { + mergedList.splice(mergedList.indexOf(conflictingItem), 1, list2Item); } - }) - return mergedList + else if (!conflictingItem) { + mergedList.push(list2Item); + } + }); + return mergedList; } async function getList() { @@ -115,7 +116,7 @@ export function useShoppingListItemActions(shoppingListId: string) { const createAndUpdateQueues = mergeListItemsByLatest(queue.update, queue.create); response.data.listItems = mergeListItemsByLatest(response.data.listItems ?? [], createAndUpdateQueues); } - return response.data + return response.data; } function createItem(item: ShoppingListItemOut) { diff --git a/frontend/pages/g/[groupSlug]/cookbooks/index.vue b/frontend/pages/g/[groupSlug]/cookbooks/index.vue index b597b07f5..a057bfe1d 100644 --- a/frontend/pages/g/[groupSlug]/cookbooks/index.vue +++ b/frontend/pages/g/[groupSlug]/cookbooks/index.vue @@ -169,12 +169,12 @@ export default defineNuxtComponent({ watch( allCookbooks, (cookbooks) => { - myCookbooks.value = - cookbooks?.filter( - (cookbook) => cookbook.householdId === $auth.user.value?.householdId, + myCookbooks.value + = cookbooks?.filter( + cookbook => cookbook.householdId === $auth.user.value?.householdId, ) ?? []; }, - { immediate: true } + { immediate: true }, ); const { household } = useHouseholdSelf(); @@ -211,7 +211,7 @@ export default defineNuxtComponent({ return; } await actions.deleteOne(deleteTarget.value.id); - myCookbooks.value = myCookbooks.value.filter((c) => c.id !== deleteTarget.value?.id); + myCookbooks.value = myCookbooks.value.filter(c => c.id !== deleteTarget.value?.id); dialogStates.delete = false; deleteTarget.value = null; } @@ -221,7 +221,7 @@ export default defineNuxtComponent({ return; } await actions.deleteOne(createTarget.value.id); - myCookbooks.value = myCookbooks.value.filter((c) => c.id !== createTarget.value?.id); + myCookbooks.value = myCookbooks.value.filter(c => c.id !== createTarget.value?.id); dialogStates.create = false; createTarget.value = null; } diff --git a/frontend/pages/shopping-lists/[id].vue b/frontend/pages/shopping-lists/[id].vue index 0bb7c29ec..e2ba88379 100644 --- a/frontend/pages/shopping-lists/[id].vue +++ b/frontend/pages/shopping-lists/[id].vue @@ -144,7 +144,7 @@ :delay-on-touch-only="true" @start="loadingCounter += 1" @end="loadingCounter -= 1" - @update:modelValue="updateIndexUnchecked" + @update:model-value="updateIndexUnchecked" >