feat: dynamic import recipe.json

This commit is contained in:
YunYouJun
2023-07-30 20:59:52 +08:00
parent 38b31a5654
commit b526aae2d0
7 changed files with 26 additions and 23 deletions

View File

@@ -5,13 +5,11 @@ export function useIndexedDB() {
const dbUpdated = useStorage(`${namespace}:lastDbUpdated`, lastDbUpdated)
return {
// db,
// initDb,
init: async () => {
const count = await db.recipes.count()
if (!count || dbUpdated.value !== lastDbUpdated) {
await initDb()
dbUpdated.value = lastDbUpdated
initDb()
}
},
}