diff --git a/src/browser/application-menu.coffee b/src/browser/application-menu.coffee index 13fa40589..22e515fcf 100644 --- a/src/browser/application-menu.coffee +++ b/src/browser/application-menu.coffee @@ -13,8 +13,6 @@ class ApplicationMenu @setActiveTemplate(@getDefaultTemplate()) global.application.autoUpdateManager.on 'state-changed', (state) => @updateAutoupdateMenuItem(state) - global.application.config.observe 'devMode', (state) => - @updateDevModeItem() # Public: Updates the entire menu with the given keybindings. # diff --git a/src/browser/application.es6 b/src/browser/application.es6 index 9fa398479..7b5ed3e5d 100644 --- a/src/browser/application.es6 +++ b/src/browser/application.es6 @@ -319,17 +319,20 @@ export default class Application extends EventEmitter { }); this.on('application:install-update', () => { - this.quitting = true - this.windowManager.cleanupBeforeAppQuit() - this.autoUpdateManager.install() + this.quitting = true; + this.windowManager.cleanupBeforeAppQuit(); + this.autoUpdateManager.install(); }); this.on('application:toggle-dev', () => { - this.devMode = !this.devMode; - this.config.set('devMode', this.devMode ? true : undefined); - this.windowManager.destroyAllWindows(); - this.windowManager.devMode = this.devMode; - this.openWindowsForTokenState(); + let args = process.argv.slice(1); + if (args.includes('--dev')) { + args = args.filter(a => a !== '--dev'); + } else { + args.push('--dev') + } + app.relaunch({args}); + app.quit(); }); if (process.platform === 'darwin') { diff --git a/src/browser/window-launcher.es6 b/src/browser/window-launcher.es6 index ddbfd7a46..ccb43d868 100644 --- a/src/browser/window-launcher.es6 +++ b/src/browser/window-launcher.es6 @@ -36,12 +36,7 @@ export default class WindowLauncher { } newWindow(options) { - // Normally, you enter dev mode by passing the --dev command line flag. - // But for developers using the compiled app, it's easier to toggle dev - // mode from the menu and have it persist through relaunch. - const devOpt = this.config.get('devMode') ? {devMode: true} : {}; - - const opts = Object.assign({}, this.defaultWindowOpts, devOpt, options); + const opts = Object.assign({}, this.defaultWindowOpts, options); let win; if (this._mustUseColdWindow(opts)) {