Skip to content

Commit

Permalink
fix tray icon on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Gottschlich committed Jul 30, 2020
1 parent 7b9becd commit e871869
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ function createWindow() {
}

// Mac Dock
app.dock.setIcon(
path.join(
isDevelopment ? __dirname : __static,
isDevelopment ? "../assets/SALogoWhiteTransparent.png" : "icon.png"
)
);
if (process.platform === "darwin") {
app.dock.setIcon(
path.join(
isDevelopment ? __dirname : __static,
isDevelopment ? "../assets/SALogoWhiteTransparent.png" : "icon.png"
)
);
}

const trayIconPath = path.join(
isDevelopment ? __dirname : process.resourcesPath,
isDevelopment
? "../assets/[email protected]"
: "[email protected]"
isDevelopment ? "../assets/[email protected]" : "[email protected]"
);
tray = new Tray(trayIconPath);

Expand All @@ -83,6 +83,10 @@ function createWindow() {
]);
tray.setContextMenu(contextMenu);

tray.on("click", () => {
win.show();
});

win.on("minimize", event => {
event.preventDefault();
win.hide();
Expand Down

0 comments on commit e871869

Please sign in to comment.