Added: picgo-core-ipc & fixed dynamic require bug in picgo

This commit is contained in:
Molunerfinn
2018-09-18 18:48:55 +08:00
parent cb32d43be4
commit aea0c3661d
4 changed files with 117 additions and 17 deletions

View File

@@ -7,6 +7,7 @@ import pasteTemplate from './utils/pasteTemplate'
import updateChecker from './utils/updateChecker'
import pkg from '../../package.json'
import picBed from '../datastore/pic-bed'
import picgoCoreIPC from './utils/picgoCoreIPC'
/**
* Set `__static` path to static files in production
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
@@ -255,7 +256,8 @@ const createSettingWindow = () => {
transparent: true,
titleBarStyle: 'hidden',
webPreferences: {
backgroundThrottling: false
backgroundThrottling: false,
webSecurity: false
}
}
if (process.platform !== 'darwin') {
@@ -398,6 +400,8 @@ const updateDefaultPicBed = () => {
}
}
picgoCoreIPC(app, ipcMain)
ipcMain.on('uploadClipboardFiles', async (evt, file) => {
const img = await uploader(file, 'imgFromClipboard', window.webContents)
if (img !== false) {