diff --git a/electron/main.js b/electron/main.js index bae9e9e5..08b0e14c 100644 --- a/electron/main.js +++ b/electron/main.js @@ -187,7 +187,7 @@ function createWindow () { mainWindow.minimize(); break; case 'quit': - app.quit(); + app.exit(); break; } break; @@ -324,15 +324,15 @@ const shouldQuit = app.makeSingleInstance((commandLine, workingDirectory) => { }); if (shouldQuit) { - app.quit(); + app.exit(); } // Code for downloading images as temporal files // Credit: Ghetto Skype (https://github.com/stanfieldr/ghetto-skype) -const tmp = require('tmp'); -const mime = require('mime'); var imageCache = {}; ipcMain.on('image:download', function(event, url, partition) { + const tmp = require('tmp'); + const mime = require('mime'); let file = imageCache[url]; if (file) { if (file.complete) { @@ -449,7 +449,7 @@ app.on('window-all-closed', function () { // On OS X it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform !== 'darwin') { - app.quit(); + app.exit(); } }); diff --git a/electron/menu.js b/electron/menu.js index 15a308eb..1848c390 100644 --- a/electron/menu.js +++ b/electron/menu.js @@ -258,8 +258,10 @@ module.exports = function(config) { type: 'separator' }, { - role: 'quit', - label: locale['tray[1]'] + label: locale['tray[1]'], + click() { + app.exit(); + } } ] }); @@ -277,8 +279,10 @@ module.exports = function(config) { type: 'separator' }, { - role: 'quit', - label: locale['menu.file[1]'] + label: locale['menu.file[1]'], + click() { + app.exit(); + } } ] }); diff --git a/electron/tray.js b/electron/tray.js index d94dd8a2..d0cd1f47 100644 --- a/electron/tray.js +++ b/electron/tray.js @@ -10,13 +10,14 @@ var appIcon = null; exports.create = function(win, config) { if (process.platform === 'darwin' || appIcon || config.get('window_display_behavior') === 'show_taskbar' ) return; + const locale = require('../resources/languages/'+config.get('locale')); const icon = process.platform === 'linux' || process.platform === 'darwin' ? 'IconTray.png' : 'Icon.ico'; const iconPath = path.join(__dirname, `../resources/${icon}`); const contextMenu = electron.Menu.buildFromTemplate([ { - label: 'Show/Hide Window' - ,click() { + label: locale['tray[0]'], + click() { win.webContents.executeJavaScript('ipc.send("toggleWin", false);'); } }, @@ -24,9 +25,9 @@ exports.create = function(win, config) { type: 'separator' }, { - label: 'Quit' - ,click() { - app.quit(); + label: locale['tray[1]'], + click() { + app.exit(); } } ]); diff --git a/masterpassword.html b/masterpassword.html index 20cde1ab..56f1fd7d 100644 --- a/masterpassword.html +++ b/masterpassword.html @@ -25,7 +25,7 @@ return doValidate({ keyCode: 13 }, document.getElementsByTagName('input')[0].value); } function exit() { - require('electron').remote.app.quit(); + require('electron').remote.app.exit(); }