mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
refactor: indexeddb初始化调整
This commit is contained in:
parent
5b88d360e2
commit
6739767f58
@ -9,6 +9,7 @@ import { onMounted } from 'vue'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { useScreenStore, useMainStore, useSnapshotStore } from '@/store'
|
||||
import { LOCALSTORAGE_KEY_DISCARDED_DB } from '@/configs/storage'
|
||||
import { deleteDiscardedDB } from '@/utils/database'
|
||||
import { isPC } from './utils/common'
|
||||
|
||||
import Editor from './views/Editor/index.vue'
|
||||
@ -26,7 +27,8 @@ if (process.env.NODE_ENV === 'production') {
|
||||
window.onbeforeunload = () => false
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
await deleteDiscardedDB()
|
||||
snapshotStore.initSnapshotDatabase()
|
||||
mainStore.setAvailableFonts()
|
||||
})
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { IndexableTypeArray } from 'dexie'
|
||||
import { db, deleteDiscardedDB, Snapshot } from '@/utils/database'
|
||||
import { db, Snapshot } from '@/utils/database'
|
||||
|
||||
import { useSlidesStore } from './slides'
|
||||
import { useMainStore } from './main'
|
||||
@ -35,8 +35,6 @@ export const useSnapshotStore = defineStore('snapshot', {
|
||||
|
||||
async initSnapshotDatabase() {
|
||||
const slidesStore = useSlidesStore()
|
||||
|
||||
await deleteDiscardedDB()
|
||||
|
||||
const newFirstSnapshot = {
|
||||
index: slidesStore.slideIndex,
|
||||
|
Loading…
x
Reference in New Issue
Block a user