fixed bug with not changing to default icon
This commit is contained in:
parent
b9e5ad3277
commit
b89a10e839
2 changed files with 3 additions and 3 deletions
|
@ -482,11 +482,11 @@ export async function createWindows() {
|
||||||
export async function setTrayIcon(iconName: string) {
|
export async function setTrayIcon(iconName: string) {
|
||||||
if (!tray) return;
|
if (!tray) return;
|
||||||
|
|
||||||
const Icons = new Set(["speaking", "muted", "deafened", "idle", "main"]);
|
const Icons = new Set(["speaking", "muted", "deafened", "idle", "icon"]);
|
||||||
|
|
||||||
if (!Icons.has(iconName)) {
|
if (!Icons.has(iconName)) {
|
||||||
console.warn("setTrayIcon: Invalid icon name", iconName);
|
console.warn("setTrayIcon: Invalid icon name", iconName);
|
||||||
iconName = "main";
|
iconName = "icon";
|
||||||
}
|
}
|
||||||
tray.setImage(join(STATIC_DIR, iconName + ".png"));
|
tray.setImage(join(STATIC_DIR, iconName + ".png"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ onceReady.then(() => {
|
||||||
if (params.state === "RTC_CONNECTED") {
|
if (params.state === "RTC_CONNECTED") {
|
||||||
setCurrentState();
|
setCurrentState();
|
||||||
} else if (params.state === "RTC_DISCONNECTED") {
|
} else if (params.state === "RTC_DISCONNECTED") {
|
||||||
VesktopNative.app.setTrayIcon("main");
|
VesktopNative.app.setTrayIcon("icon");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue