Changeset View
Changeset View
Standalone View
Standalone View
desktop/src/main.js
// @flow | // @flow | ||||
import { | import { | ||||
app, | app, | ||||
BrowserWindow, | BrowserWindow, | ||||
shell, | shell, | ||||
Menu, | Menu, | ||||
ipcMain, | ipcMain, | ||||
systemPreferences, | systemPreferences, | ||||
autoUpdater, | autoUpdater, | ||||
dialog, | |||||
// eslint-disable-next-line import/extensions | // eslint-disable-next-line import/extensions | ||||
} from 'electron/main'; | } from 'electron/main'; | ||||
import fs from 'fs'; | import fs from 'fs'; | ||||
import path from 'path'; | import path from 'path'; | ||||
import { initAutoUpdate } from './auto-update.js'; | import { initAutoUpdate } from './auto-update.js'; | ||||
import { handleSquirrelEvent } from './handle-squirrel-event.js'; | import { handleSquirrelEvent } from './handle-squirrel-event.js'; | ||||
▲ Show 20 Lines • Show All 262 Lines • ▼ Show 20 Lines | |||||
if (app.isPackaged && process.platform === 'win32') { | if (app.isPackaged && process.platform === 'win32') { | ||||
if (!handleSquirrelEvent()) { | if (!handleSquirrelEvent()) { | ||||
run(); | run(); | ||||
} | } | ||||
} else { | } else { | ||||
run(); | run(); | ||||
} | } | ||||
process.on('uncaughtException', (error: Error) => { | |||||
if (error.message === 'The internet connection appears to be offline.') { | |||||
return; | |||||
} | |||||
dialog.showErrorBox( | |||||
'A JavaScript error occurred in the main process', | |||||
`Uncaught Exception: ${error.name}: ${error.message}`, | |||||
); | |||||
}); |