feat: 添加对数据库初始化的调用,优化设置存储逻辑
This commit is contained in:
@@ -55,10 +55,10 @@ class SettingStore {
|
||||
* 自动判断重连
|
||||
*/
|
||||
private _ensureDB = safe(async () => {
|
||||
const { db, isDbClosed } = this
|
||||
const { db, isDbClosed, initDB } = this
|
||||
|
||||
if (!db || isDbClosed) {
|
||||
this.db = await openDatabase({ name: DB_SETTINGS_NAME })
|
||||
await initDB()
|
||||
this.isDbClosed = false
|
||||
}
|
||||
})
|
||||
@@ -182,5 +182,3 @@ class SettingStore {
|
||||
* ```
|
||||
*/
|
||||
export const settingsStore = new SettingStore()
|
||||
|
||||
await settingsStore.initDB()
|
||||
|
||||
Reference in New Issue
Block a user