mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-09-05 23:47:43 +08:00
🐛 Fix: bug of gallery db for plugin
This commit is contained in:
+18
-14
@@ -150,20 +150,24 @@ class GuiApi implements IGuiApi {
|
|||||||
return new Proxy<DBStore>(GalleryDB.getInstance(), {
|
return new Proxy<DBStore>(GalleryDB.getInstance(), {
|
||||||
get (target, prop: keyof DBStore) {
|
get (target, prop: keyof DBStore) {
|
||||||
if (prop === 'removeById') {
|
if (prop === 'removeById') {
|
||||||
return new Promise((resolve) => {
|
return new Proxy(GalleryDB.getInstance().removeById, {
|
||||||
const guiApi = GuiApi.getInstance()
|
apply (target, ctx, args) {
|
||||||
guiApi.showMessageBox({
|
return new Promise((resolve) => {
|
||||||
title: '警告',
|
const guiApi = GuiApi.getInstance()
|
||||||
message: '有插件正在试图删除一些相册文件,是否继续',
|
guiApi.showMessageBox({
|
||||||
type: 'info',
|
title: '警告',
|
||||||
buttons: ['Yes', 'No']
|
message: '有插件正在试图删除一些相册图片,是否继续',
|
||||||
}).then(res => {
|
type: 'info',
|
||||||
if (res.result === 0) {
|
buttons: ['Yes', 'No']
|
||||||
resolve(Reflect.get(target, prop))
|
}).then(res => {
|
||||||
} else {
|
if (res.result === 0) {
|
||||||
resolve(() => {})
|
resolve(Reflect.apply(target, ctx, args))
|
||||||
}
|
} else {
|
||||||
})
|
resolve(undefined)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return Reflect.get(target, prop)
|
return Reflect.get(target, prop)
|
||||||
|
|||||||
@@ -155,9 +155,13 @@ export default class extends Vue {
|
|||||||
picBed: IPicBedType[] = []
|
picBed: IPicBedType[] = []
|
||||||
@Watch('$route')
|
@Watch('$route')
|
||||||
handleRouteUpdate (to: any, from: any) {
|
handleRouteUpdate (to: any, from: any) {
|
||||||
|
console.log(to, from)
|
||||||
if (from.name === 'gallery') {
|
if (from.name === 'gallery') {
|
||||||
this.clearChoosedList()
|
this.clearChoosedList()
|
||||||
}
|
}
|
||||||
|
if (to.name === 'gallery') {
|
||||||
|
this.updateGallery()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
async created () {
|
async created () {
|
||||||
ipcRenderer.on('updateGallery', (event: IpcRendererEvent) => {
|
ipcRenderer.on('updateGallery', (event: IpcRendererEvent) => {
|
||||||
|
|||||||
@@ -268,7 +268,8 @@ export default class extends Vue {
|
|||||||
_this.configName = plugin.config[i].fullName || plugin.config[i].name
|
_this.configName = plugin.config[i].fullName || plugin.config[i].name
|
||||||
_this.dialogVisible = true
|
_this.dialogVisible = true
|
||||||
_this.config = plugin.config[i].config
|
_this.config = plugin.config[i].config
|
||||||
}
|
},
|
||||||
|
enabled: plugin.enabled
|
||||||
}
|
}
|
||||||
menu.push(obj)
|
menu.push(obj)
|
||||||
}
|
}
|
||||||
@@ -477,9 +478,6 @@ export default class extends Vue {
|
|||||||
goAwesomeList () {
|
goAwesomeList () {
|
||||||
remote.shell.openExternal('https://github.com/PicGo/Awesome-PicGo')
|
remote.shell.openExternal('https://github.com/PicGo/Awesome-PicGo')
|
||||||
}
|
}
|
||||||
saveConfig (data: IObj) {
|
|
||||||
ipcRenderer.send('picgoSaveData', data)
|
|
||||||
}
|
|
||||||
handleImportLocalPlugin () {
|
handleImportLocalPlugin () {
|
||||||
ipcRenderer.send('importLocalPlugin')
|
ipcRenderer.send('importLocalPlugin')
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export default class extends Vue {
|
|||||||
[config]: value
|
[config]: value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log(PICGO_SAVE_CONFIG, config, value)
|
||||||
ipcRenderer.send(PICGO_SAVE_CONFIG, config)
|
ipcRenderer.send(PICGO_SAVE_CONFIG, config)
|
||||||
}
|
}
|
||||||
getConfig<T> (key?: string): Promise<T | undefined> {
|
getConfig<T> (key?: string): Promise<T | undefined> {
|
||||||
|
|||||||
+1
-1
@@ -95,7 +95,7 @@ const config = {
|
|||||||
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
config.configureWebpack = {
|
config.configureWebpack = {
|
||||||
devtool: 'eval-source-map'
|
devtool: 'source-map'
|
||||||
}
|
}
|
||||||
// for dev main process hot reload
|
// for dev main process hot reload
|
||||||
config.pluginOptions.electronBuilder.mainProcessWatch = ['src/main/**/*']
|
config.pluginOptions.electronBuilder.mainProcessWatch = ['src/main/**/*']
|
||||||
|
|||||||
Reference in New Issue
Block a user