From 2139fb74bbbd3c7f1865efd49342029939393584 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 23 Apr 2017 09:56:43 +0100 Subject: [PATCH] change show logic to same as that of the tray icon Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/vector/platform/ElectronPlatform.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index b0928a8f4..21d324a49 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -106,13 +106,14 @@ export default class ElectronPlatform extends VectorBasePlatform { notification.onclick = function() { dis.dispatch({ action: 'view_room', - room_id: room.roomId + room_id: room.roomId, }); global.focus(); - const currentWin = electron.remote.getCurrentWindow(); - currentWin.show(); - currentWin.restore(); - currentWin.focus(); + const win = electron.remote.getCurrentWindow(); + + if (win.isMinimized()) win.restore(); + else if (!win.isVisible()) win.show(); + else win.focus(); }; return notification;