From d9860935c1fcd710f00548c0e426f73f786f36c2 Mon Sep 17 00:00:00 2001 From: antelle Date: Tue, 8 Jan 2019 18:39:38 +0100 Subject: [PATCH] fixed window activation when KeeWeb is launched second time --- desktop/app.js | 9 ++++++++- release-notes.md | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/desktop/app.js b/desktop/app.js index 8a40caa9..00aa80d7 100644 --- a/desktop/app.js +++ b/desktop/app.js @@ -1,8 +1,9 @@ const electron = require('electron'); -const app = electron.app; const path = require('path'); const fs = require('fs'); +const app = electron.app; + let mainWindow = null; let appIcon = null; let ready = false; @@ -42,6 +43,7 @@ app.on('window-all-closed', () => { app.removeAllListeners('ready'); app.removeAllListeners('open-file'); app.removeAllListeners('activate'); + app.removeAllListeners('single-instance'); electron.globalShortcut.unregisterAll(); electron.powerMonitor.removeAllListeners('suspend'); electron.powerMonitor.removeAllListeners('resume'); @@ -83,6 +85,11 @@ app.on('activate', () => { app.on('will-quit', () => { electron.globalShortcut.unregisterAll(); }); +app.on('second-instance', () => { + if (mainWindow) { + restoreMainWindow(); + } +}); app.restartApp = function () { restartPending = true; mainWindow.close(); diff --git a/release-notes.md b/release-notes.md index f90d03ca..85f97efb 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,5 +1,8 @@ Release notes ------------- +##### v1.7.3 (TBD) +`-` fixed window activation when KeeWeb is launched second time + ##### v1.7.2 (2019-01-07) `-` fixed Google Drive cookies issues `-` fixed storage providers authentication