🐛 Fix: right-click menu upload fails with PicGo open

ISSUES CLOSED: #415
This commit is contained in:
Molunerfinn
2020-04-11 11:05:58 +08:00
parent 3df2253ae9
commit 96cdfea497
+15 -16
View File
@@ -65,17 +65,15 @@ if (!gotTheLock) {
} }
} }
}) })
} if (process.platform === 'win32') {
if (process.platform === 'win32') {
app.setAppUserModelId('com.molunerfinn.picgo') app.setAppUserModelId('com.molunerfinn.picgo')
} }
if (process.env.XDG_CURRENT_DESKTOP && process.env.XDG_CURRENT_DESKTOP.includes('Unity')) { if (process.env.XDG_CURRENT_DESKTOP && process.env.XDG_CURRENT_DESKTOP.includes('Unity')) {
process.env.XDG_CURRENT_DESKTOP = 'Unity' process.env.XDG_CURRENT_DESKTOP = 'Unity'
} }
app.on('ready', async () => { app.on('ready', async () => {
createProtocol('picgo') createProtocol('picgo')
if (isDevelopment && !process.env.IS_TEST) { if (isDevelopment && !process.env.IS_TEST) {
// Install Vue Devtools // Install Vue Devtools
@@ -109,15 +107,15 @@ app.on('ready', async () => {
} }
} }
} }
}) })
app.on('window-all-closed', () => { app.on('window-all-closed', () => {
if (process.platform !== 'darwin') { if (process.platform !== 'darwin') {
app.quit() app.quit()
} }
}) })
app.on('activate', () => { app.on('activate', () => {
createProtocol('picgo') createProtocol('picgo')
if (!windowManager.has(IWindowList.TRAY_WINDOW)) { if (!windowManager.has(IWindowList.TRAY_WINDOW)) {
windowManager.create(IWindowList.TRAY_WINDOW) windowManager.create(IWindowList.TRAY_WINDOW)
@@ -125,17 +123,18 @@ app.on('activate', () => {
if (!windowManager.has(IWindowList.SETTING_WINDOW)) { if (!windowManager.has(IWindowList.SETTING_WINDOW)) {
windowManager.create(IWindowList.SETTING_WINDOW) windowManager.create(IWindowList.SETTING_WINDOW)
} }
}) })
app.on('will-quit', () => { app.on('will-quit', () => {
globalShortcut.unregisterAll() globalShortcut.unregisterAll()
bus.removeAllListeners() bus.removeAllListeners()
server.shutdown() server.shutdown()
}) })
app.setLoginItemSettings({ app.setLoginItemSettings({
openAtLogin: db.get('settings.autoStart') || false openAtLogin: db.get('settings.autoStart') || false
}) })
}
// Exit cleanly on request from parent process in development mode. // Exit cleanly on request from parent process in development mode.
if (isDevelopment) { if (isDevelopment) {