Skip to content

Commit 21df87c

Browse files
Fix tray path on non darwin
1 parent 320a9d6 commit 21df87c

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

app/main/lib/tray.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ import path from "path";
44
import packageJson from "../../../package.json";
55
import { Settings } from "../../types/settings";
66
import {
7-
checkIdle,
8-
checkInWorkingHours,
9-
createBreak,
10-
getBreakTime,
11-
startBreakNow,
7+
checkIdle,
8+
checkInWorkingHours,
9+
createBreak,
10+
getBreakTime,
11+
startBreakNow
1212
} from "./breaks";
1313
import {
14-
getDisableEndTime,
15-
getSettings,
16-
setDisableEndTime,
17-
setSettings,
14+
getDisableEndTime,
15+
getSettings,
16+
setDisableEndTime,
17+
setSettings
1818
} from "./store";
1919
import { createSettingsWindow } from "./windows";
2020

@@ -59,22 +59,22 @@ function getDisableTimeRemaining(): string {
5959
}
6060

6161
export function buildTray(): void {
62-
if (!tray) {
63-
let imgPath;
64-
65-
if (process.platform === "darwin") {
66-
imgPath =
67-
process.env.NODE_ENV === "development"
68-
? "resources/tray/tray-IconTemplate.png"
69-
: path.join(resourcesPath, "tray", "tray-IconTemplate.png");
70-
} else {
71-
imgPath =
72-
process.env.NODE_ENV === "development"
73-
? "resources/tray/icon.png"
74-
: path.join(resourcesPath, "tray", "icon.png");
75-
}
76-
77-
tray = new Tray(imgPath);
62+
if (!tray) {
63+
let imgPath;
64+
65+
if (process.platform === "darwin") {
66+
imgPath =
67+
process.env.NODE_ENV === "development"
68+
? "resources/tray/tray-IconTemplate.png"
69+
: path.join(resourcesPath, "tray", "tray-IconTemplate.png");
70+
} else {
71+
imgPath =
72+
process.env.NODE_ENV === "development"
73+
? "resources/tray/icon.png"
74+
: path.join(app.getAppPath(), "..", "tray", "icon.png");
75+
}
76+
77+
tray = new Tray(imgPath);
7878

7979
// On windows, context menu will not show on left click by default
8080
if (process.platform === "win32") {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)