Advertisement
Guest User

main.js to main.dev.js

a guest
Mar 1st, 2018
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Raven from 'raven';
  2. import { app, globalShortcut } from 'electron';
  3. import { ApplicationManager, MainWindow } from './app';
  4.  
  5. let mainWindow = null;
  6.  
  7. let dev = false;
  8. if (process.defaultApp || /[\\/]electron[\\/]/.test(process.execPath)) {
  9.   dev = true;
  10. }
  11. global.dev = dev;
  12.  
  13.  
  14. if (!dev) {
  15.   Raven.config('https://c561764525994abbb3ca1faae8e6f460@sentry.gamecredits.org/6', {
  16.     release: app.getVersion()
  17.   }).install();
  18. }
  19.  
  20. app.on('ready', () => {
  21.   mainWindow = new MainWindow(dev, __dirname, ApplicationManager);
  22.  
  23.   ApplicationManager.init(mainWindow);
  24.  
  25.   globalShortcut.register('CommandOrControl+Shift+K', () => {
  26.     mainWindow.browserWindow.webContents.openDevTools();
  27.   });
  28. });
  29.  
  30. app.on('window-all-closed', () => {
  31.   ApplicationManager.close();
  32.  
  33.   // On macOS it is common for applications and their menu bar
  34.   // to stay active until the user quits explicitly with Cmd + Q
  35.   if (process.platform !== 'darwin') {
  36.     app.quit();
  37.   }
  38. });
  39.  
  40. app.on('activate', () => {
  41.   // On macOS it's common to re-create a window in the app when the
  42.   // dock icon is clicked and there are no other windows open.
  43.   if (mainWindow === null) {
  44.     mainWindow = new MainWindow(dev);
  45.   }
  46. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement