Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Lohage authored and Jan Lohage committed Nov 21, 2019
1 parent f546309 commit e844b2f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/index.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/* eslint-disable */

// Install `electron-debug` with `devtron`
require('electron-debug')({ showDevTools: true })
require('electron-debug')()

// Install `vue-devtools`
require('electron').app.on('ready', () => {
Expand All @@ -21,4 +21,4 @@ require('electron').app.on('ready', () => {
})

// Require `main` process to boot app
require('./index')
require('./index')
12 changes: 11 additions & 1 deletion src/main/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { app, BrowserWindow, shell } from 'electron' // eslint-disable-line
import { app, BrowserWindow, shell } from 'electron'; // eslint-disable-line
import windowStateKeeper from 'electron-window-state';
import path from 'path';
import { sentry } from '../constants';
Expand Down Expand Up @@ -51,6 +51,16 @@ function createWindow() {

mainWindow.loadURL(winURL);

// Open dev tools initially when in development mode
if (process.env.NODE_ENV === 'development') {
mainWindow.webContents.on('did-frame-finish-load', () => {
mainWindow.webContents.once('devtools-opened', () => {
mainWindow.focus();
});
mainWindow.webContents.openDevTools();
});
}

mainWindow.on('closed', () => {
mainWindow = null;
});
Expand Down

0 comments on commit e844b2f

Please sign in to comment.