diff --git a/src/browser/webview/mattermost.js b/src/browser/webview/mattermost.js index 353efce5..b9679f60 100644 --- a/src/browser/webview/mattermost.js +++ b/src/browser/webview/mattermost.js @@ -107,12 +107,18 @@ notification.override({ }, // Show window even if it is hidden/minimized when notification is clicked. onclick: function() { + const currentWindow = electron.remote.getCurrentWindow(); if (process.platform === 'win32') { // show() breaks Aero Snap state. - electron.remote.getCurrentWindow().focus(); + if (currentWindow.isVisible()) { + currentWindow.focus(); + } + else { + currentWindow.show(); + } } else { - electron.remote.getCurrentWindow().show(); + currentWindow.show(); } ipc.sendToHost('onNotificationClick'); }