mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-09-05 07:28:42 +08:00
🐛 Fix: right-click menu upload fails with PicGo open
ISSUES CLOSED: #415
This commit is contained in:
+61
-62
@@ -65,77 +65,76 @@ if (!gotTheLock) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
if (process.platform === 'win32') {
|
||||||
|
app.setAppUserModelId('com.molunerfinn.picgo')
|
||||||
|
}
|
||||||
|
|
||||||
if (process.platform === 'win32') {
|
if (process.env.XDG_CURRENT_DESKTOP && process.env.XDG_CURRENT_DESKTOP.includes('Unity')) {
|
||||||
app.setAppUserModelId('com.molunerfinn.picgo')
|
process.env.XDG_CURRENT_DESKTOP = 'Unity'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.XDG_CURRENT_DESKTOP && process.env.XDG_CURRENT_DESKTOP.includes('Unity')) {
|
app.on('ready', async () => {
|
||||||
process.env.XDG_CURRENT_DESKTOP = 'Unity'
|
createProtocol('picgo')
|
||||||
}
|
if (isDevelopment && !process.env.IS_TEST) {
|
||||||
|
|
||||||
app.on('ready', async () => {
|
|
||||||
createProtocol('picgo')
|
|
||||||
if (isDevelopment && !process.env.IS_TEST) {
|
|
||||||
// Install Vue Devtools
|
// Install Vue Devtools
|
||||||
try {
|
try {
|
||||||
await installVueDevtools()
|
await installVueDevtools()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Vue Devtools failed to install:', e.toString())
|
console.error('Vue Devtools failed to install:', e.toString())
|
||||||
}
|
|
||||||
}
|
|
||||||
windowManager.create(IWindowList.TRAY_WINDOW)
|
|
||||||
windowManager.create(IWindowList.SETTING_WINDOW)
|
|
||||||
if (process.platform === 'darwin' || process.platform === 'win32') {
|
|
||||||
createTray()
|
|
||||||
}
|
|
||||||
db.set('needReload', false)
|
|
||||||
updateChecker()
|
|
||||||
// 不需要阻塞
|
|
||||||
process.nextTick(() => {
|
|
||||||
updateShortKeyFromVersion212(db, db.get('settings.shortKey'))
|
|
||||||
shortKeyHandler.init()
|
|
||||||
})
|
|
||||||
server.startup()
|
|
||||||
if (process.env.NODE_ENV !== 'development') {
|
|
||||||
let files = getUploadFiles()
|
|
||||||
if (files === null || files.length > 0) { // 如果有文件列表作为参数,说明是命令行启动
|
|
||||||
if (files === null) {
|
|
||||||
uploadClipboardFiles()
|
|
||||||
} else {
|
|
||||||
const win = windowManager.getAvailableWindow()
|
|
||||||
uploadChoosedFiles(win.webContents, files)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
|
||||||
if (process.platform !== 'darwin') {
|
|
||||||
app.quit()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
app.on('activate', () => {
|
|
||||||
createProtocol('picgo')
|
|
||||||
if (!windowManager.has(IWindowList.TRAY_WINDOW)) {
|
|
||||||
windowManager.create(IWindowList.TRAY_WINDOW)
|
windowManager.create(IWindowList.TRAY_WINDOW)
|
||||||
}
|
|
||||||
if (!windowManager.has(IWindowList.SETTING_WINDOW)) {
|
|
||||||
windowManager.create(IWindowList.SETTING_WINDOW)
|
windowManager.create(IWindowList.SETTING_WINDOW)
|
||||||
}
|
if (process.platform === 'darwin' || process.platform === 'win32') {
|
||||||
})
|
createTray()
|
||||||
|
}
|
||||||
|
db.set('needReload', false)
|
||||||
|
updateChecker()
|
||||||
|
// 不需要阻塞
|
||||||
|
process.nextTick(() => {
|
||||||
|
updateShortKeyFromVersion212(db, db.get('settings.shortKey'))
|
||||||
|
shortKeyHandler.init()
|
||||||
|
})
|
||||||
|
server.startup()
|
||||||
|
if (process.env.NODE_ENV !== 'development') {
|
||||||
|
let files = getUploadFiles()
|
||||||
|
if (files === null || files.length > 0) { // 如果有文件列表作为参数,说明是命令行启动
|
||||||
|
if (files === null) {
|
||||||
|
uploadClipboardFiles()
|
||||||
|
} else {
|
||||||
|
const win = windowManager.getAvailableWindow()
|
||||||
|
uploadChoosedFiles(win.webContents, files)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
app.on('will-quit', () => {
|
app.on('window-all-closed', () => {
|
||||||
globalShortcut.unregisterAll()
|
if (process.platform !== 'darwin') {
|
||||||
bus.removeAllListeners()
|
app.quit()
|
||||||
server.shutdown()
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
app.setLoginItemSettings({
|
app.on('activate', () => {
|
||||||
openAtLogin: db.get('settings.autoStart') || false
|
createProtocol('picgo')
|
||||||
})
|
if (!windowManager.has(IWindowList.TRAY_WINDOW)) {
|
||||||
|
windowManager.create(IWindowList.TRAY_WINDOW)
|
||||||
|
}
|
||||||
|
if (!windowManager.has(IWindowList.SETTING_WINDOW)) {
|
||||||
|
windowManager.create(IWindowList.SETTING_WINDOW)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app.on('will-quit', () => {
|
||||||
|
globalShortcut.unregisterAll()
|
||||||
|
bus.removeAllListeners()
|
||||||
|
server.shutdown()
|
||||||
|
})
|
||||||
|
|
||||||
|
app.setLoginItemSettings({
|
||||||
|
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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user