From dd3cf32290ec35c84abb1a8cbd222eda9b61598a Mon Sep 17 00:00:00 2001 From: YunYouJun Date: Sun, 19 Feb 2023 06:36:07 +0800 Subject: [PATCH] chore: fix lint --- src/components/ChooseFood.vue | 2 +- src/composables/recipe.ts | 4 ++-- src/modules/pwa.ts | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/ChooseFood.vue b/src/components/ChooseFood.vue index c56c982..f49b5ec 100644 --- a/src/components/ChooseFood.vue +++ b/src/components/ChooseFood.vue @@ -23,7 +23,7 @@ const { playAnimation } = useEmojiAnimation(recipeBtn) const gtm = useGtm() -const toggleStuff = (item: StuffItem, category = '', e?: Event) => { +const toggleStuff = (item: StuffItem, category = '', _e?: Event) => { rStore.toggleStuff(item.name) if (curStuff.value.includes(item.name)) diff --git a/src/composables/recipe.ts b/src/composables/recipe.ts index 51d352a..192a130 100644 --- a/src/composables/recipe.ts +++ b/src/composables/recipe.ts @@ -24,7 +24,7 @@ export function useRecipe(recipe: Ref) { return recipe.value.filter((item) => { const stuffFlag = curStuff.value.every(stuff => item.stuff.includes(stuff)) const toolFlag = item.tools?.includes(curTool.value) - return curTool.value ? stuffFlag && toolFlag : stuffFlag + return curTool.value ? (stuffFlag && toolFlag) : stuffFlag }) } else if (curMode.value === 'loose') { @@ -51,7 +51,7 @@ export function useRecipe(recipe: Ref) { return recipe.value.filter((item) => { const stuffFlag = item.stuff.every(stuff => curStuff.value.includes(stuff)) const toolFlag = item.tools?.includes(curTool.value) - return curTool.value ? stuffFlag && toolFlag : stuffFlag + return curTool.value ? (stuffFlag && toolFlag) : stuffFlag }) } }) diff --git a/src/modules/pwa.ts b/src/modules/pwa.ts index a6dc72f..51abda6 100644 --- a/src/modules/pwa.ts +++ b/src/modules/pwa.ts @@ -1,13 +1,13 @@ import { type UserModule } from '~/types' // https://github.com/antfu/vite-plugin-pwa#automatic-reload-when-new-content-available -// eslint-disable-next-line @typescript-eslint/no-unused-vars -export const install: UserModule = ({ isClient, router }) => { - // if (!isClient) - // return - // router.isReady().then(async () => { +export const install: UserModule = ({ isClient, router }) => { + if (!isClient) + return + + router.isReady().then(async () => { // const { registerSW } = await import('virtual:pwa-register') // registerSW({ immediate: true }) - // }) + }) }