mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-07-12 16:11:27 +08:00
Partly finished: plugin system
This commit is contained in:
@@ -522,6 +522,7 @@ app.on('ready', () => {
|
||||
if (process.platform === 'darwin' || process.platform === 'win32') {
|
||||
createTray()
|
||||
}
|
||||
db.read().set('needReload', false).write()
|
||||
updateChecker()
|
||||
|
||||
globalShortcut.register(db.read().get('settings.shortKey.upload').value(), () => {
|
||||
|
||||
@@ -18,6 +18,7 @@ const getPicBeds = (app) => {
|
||||
visible: visible ? visible.visible : true
|
||||
}
|
||||
})
|
||||
picgo.cmd.program.removeAllListeners()
|
||||
return picBeds
|
||||
}
|
||||
|
||||
|
||||
@@ -114,9 +114,14 @@ const handlePluginUpdate = (ipcMain, CONFIG_PATH) => {
|
||||
const handleGetPicBedConfig = (ipcMain, CONFIG_PATH) => {
|
||||
ipcMain.on('getPicBedConfig', (event, type) => {
|
||||
const picgo = new PicGo(CONFIG_PATH)
|
||||
const config = handleConfigWithFunction(picgo.helper.uploader.get(type).config(picgo))
|
||||
const name = picgo.helper.uploader.get(type).name || type
|
||||
event.sender.send('getPicBedConfig', config, name)
|
||||
if (picgo.helper.uploader.get(type).config) {
|
||||
const config = handleConfigWithFunction(picgo.helper.uploader.get(type).config(picgo))
|
||||
event.sender.send('getPicBedConfig', config, name)
|
||||
} else {
|
||||
event.sender.send('getPicBedConfig', [], name)
|
||||
}
|
||||
picgo.cmd.program.removeAllListeners()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user