fix: check curStuff.value

This commit is contained in:
YunYouJun
2022-06-27 09:05:00 +08:00
parent 0f1dbe1602
commit 19d56a3be8
3 changed files with 8 additions and 5 deletions

View File

@@ -10,10 +10,11 @@
<meta name="description" content="好的,今天我们来做菜!">
<title>隔离食用手册</title>
<script>
(function () {
navigator.serviceWorker.getRegistrations().then((registrations) => {
for (const registration of registrations)
registration.unregister()
})
for (const registration of registrations) registration.unregister()
})
})()
</script>
<script>
(function () {

View File

@@ -1,4 +1,5 @@
<script setup lang="ts">
// @ts-expect-error remove pwa
import { useRegisterSW } from 'virtual:pwa-register/vue'
const {

View File

@@ -21,8 +21,9 @@ export const useRecipeStore = defineStore('recipe', () => {
const curMode = useStorage<SearchMode>(`${namespace}:mode`, 'loose')
function toggleStuff(name: string) {
if (!curStuff)
if (!curStuff.value)
return
if (curStuff.value.has(name))
curStuff.value.delete(name)
else