Skip to content

Commit 2139fb7

Browse files
committed
change show logic to same as that of the tray icon
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
1 parent 8b4ab4b commit 2139fb7

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎src/vector/platform/ElectronPlatform.js‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,14 @@ export default class ElectronPlatform extends VectorBasePlatform {
106106
notification.onclick = function() {
107107
dis.dispatch({
108108
action: 'view_room',
109-
room_id: room.roomId
109+
room_id: room.roomId,
110110
});
111111
global.focus();
112-
const currentWin = electron.remote.getCurrentWindow();
113-
currentWin.show();
114-
currentWin.restore();
115-
currentWin.focus();
112+
const win = electron.remote.getCurrentWindow();
113+
114+
if (win.isMinimized()) win.restore();
115+
else if (!win.isVisible()) win.show();
116+
else win.focus();
116117
};
117118

118119
return notification;

0 commit comments

Comments
 (0)