message: only allow single instance of app
diff: @@ -8,7 +8,6 @@ const squirrelStartup = require('electron-squirrel-startup');
  const { getConfigField } = require('./config.js');
  const { isMac, isDevEnv } = require('./utils/misc.js');
  -
  // exit early for squirrel installer
  if (squirrelStartup) {
  return;
  @@ -19,9 +18,25 @@ require('./mainApiMgr.js');
  // monitor memory of main process
  require('./memoryMonitor.js');
  -
  const windowMgr = require('./windowMgr.js');
  +// only allow a single instance of app.
  +const shouldQuit = app.makeSingleInstance(() => {
  + // Someone tried to run a second instance, we should focus our window.
  + let mainWin = windowMgr.getMainWindow();
  + if (mainWin) {
  + if (mainWin.isMinimized()) {
  + mainWin.restore();
  + }
  + mainWin.focus();
  + }
  +});
  +
  +// quit if another instance is already running
  +if (shouldQuit) {
  + app.quit();
  +}
  +
  /**
  * This method will be called when Electron has finished
  * initialization and is ready to create browser windows.
  