fix: toggle window visibility on tray click instead of always showing (#103)
This commit is contained in:
parent
2b962c5d06
commit
742a95f3cb
|
|
@ -28,8 +28,12 @@ export function initTray() {
|
||||||
tray.setToolTip("Stoat for Desktop");
|
tray.setToolTip("Stoat for Desktop");
|
||||||
tray.setImage(trayIcon);
|
tray.setImage(trayIcon);
|
||||||
tray.on("click", () => {
|
tray.on("click", () => {
|
||||||
mainWindow.show();
|
if (mainWindow.isVisible()) {
|
||||||
mainWindow.focus();
|
mainWindow.hide();
|
||||||
|
} else {
|
||||||
|
mainWindow.show();
|
||||||
|
mainWindow.focus();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue