🐛 Fix: gallery db bug

This commit is contained in:
PiEgg
2021-08-01 14:50:25 +08:00
parent 6ddd660d89
commit f1eb7f4d70
18 changed files with 145 additions and 56 deletions

View File

@@ -55,7 +55,7 @@ const handleStartUpFiles = (argv: string[], cwd: string) => {
}
class LifeCycle {
private async beforeReady () {
private beforeReady () {
protocol.registerSchemesAsPrivileged([{ scheme: 'picgo', privileges: { secure: true, standard: true } }])
// fix the $PATH in macOS
fixPath()
@@ -63,10 +63,11 @@ class LifeCycle {
ipcList.listen()
busEventList.listen()
updateShortKeyFromVersion212(db, db.get('settings.shortKey'))
await migrateGalleryFromVersion230(db, GalleryDB.getInstance())
}
private onReady () {
app.on('ready', async () => {
console.log('on ready')
await migrateGalleryFromVersion230(db, GalleryDB.getInstance())
createProtocol('picgo')
if (isDevelopment && !process.env.IS_TEST) {
// Install Vue Devtools
@@ -169,7 +170,7 @@ class LifeCycle {
if (!gotTheLock) {
app.quit()
} else {
await this.beforeReady()
this.beforeReady()
this.onReady()
this.onRunning()
this.onQuit()