mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 22:43:34 -07:00
fix a bunch of lint issues
This commit is contained in:
parent
a7d330d062
commit
5e9117f1ff
4 changed files with 26 additions and 23 deletions
|
@ -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];
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@
|
|||
:delay-on-touch-only="true"
|
||||
@start="loadingCounter += 1"
|
||||
@end="loadingCounter -= 1"
|
||||
@update:modelValue="updateIndexUnchecked"
|
||||
@update:model-value="updateIndexUnchecked"
|
||||
>
|
||||
<v-lazy
|
||||
v-for="(item, index) in listItems.unchecked"
|
||||
|
@ -197,7 +197,7 @@
|
|||
:delay-on-touch-only="true"
|
||||
@start="loadingCounter += 1"
|
||||
@end="loadingCounter -= 1"
|
||||
@update:modelValue="updateIndexUncheckedByLabel(key.toString(), $event)"
|
||||
@update:model-value="updateIndexUncheckedByLabel(key.toString(), $event)"
|
||||
>
|
||||
<v-lazy
|
||||
v-for="(item, index) in value"
|
||||
|
@ -268,7 +268,7 @@
|
|||
:delay="250"
|
||||
:delay-on-touch-only="true"
|
||||
class="my-2"
|
||||
@update:modelValue="updateLabelOrder"
|
||||
@update:model-value="updateLabelOrder"
|
||||
>
|
||||
<div
|
||||
v-for="(labelSetting, index) in localLabels"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue