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:
parent
43ea13cfc3
commit
fc20733dde
@ -31,9 +31,8 @@ nativeTheme.on("updated", async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export async function initTray(windowManager: WindowManager) {
|
export async function initTray(windowManager: WindowManager) {
|
||||||
if (!trayIcon) {
|
trayIcon = await createTrayIconFromSvg(); // generate icon once on tray activation
|
||||||
trayIcon = await createTrayIconFromSvg();
|
|
||||||
}
|
|
||||||
const dispose = autorun(() => {
|
const dispose = autorun(() => {
|
||||||
const menu = createTrayMenu(windowManager);
|
const menu = createTrayMenu(windowManager);
|
||||||
buildTray(trayIcon, menu);
|
buildTray(trayIcon, menu);
|
||||||
|
|||||||
@ -59,8 +59,9 @@ export class WindowManager {
|
|||||||
this.disposers.trayAutoBind = reaction(() => userStore.preferences.trayEnabled, async isEnabled => {
|
this.disposers.trayAutoBind = reaction(() => userStore.preferences.trayEnabled, async isEnabled => {
|
||||||
if (isEnabled) {
|
if (isEnabled) {
|
||||||
this.disposers.trayAutoUpdater = await initTray(this);
|
this.disposers.trayAutoUpdater = await initTray(this);
|
||||||
} else {
|
} else if (this.disposers.trayAutoUpdater) {
|
||||||
this.disposers?.trayAutoUpdater();
|
this.disposers.trayAutoUpdater();
|
||||||
|
this.disposers.trayAutoUpdater = null;
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
fireImmediately: true
|
fireImmediately: true
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user