1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

fix: refresh icon after turning on/off + switching dark-mode

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2020-10-07 14:01:20 +03:00
parent 43ea13cfc3
commit fc20733dde
2 changed files with 5 additions and 5 deletions

View File

@ -31,9 +31,8 @@ nativeTheme.on("updated", async () => {
});
export async function initTray(windowManager: WindowManager) {
if (!trayIcon) {
trayIcon = await createTrayIconFromSvg();
}
trayIcon = await createTrayIconFromSvg(); // generate icon once on tray activation
const dispose = autorun(() => {
const menu = createTrayMenu(windowManager);
buildTray(trayIcon, menu);

View File

@ -59,8 +59,9 @@ export class WindowManager {
this.disposers.trayAutoBind = reaction(() => userStore.preferences.trayEnabled, async isEnabled => {
if (isEnabled) {
this.disposers.trayAutoUpdater = await initTray(this);
} else {
this.disposers?.trayAutoUpdater();
} else if (this.disposers.trayAutoUpdater) {
this.disposers.trayAutoUpdater();
this.disposers.trayAutoUpdater = null;
}
}, {
fireImmediately: true