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) {
|
||||
if (!trayIcon) {
|
||||
trayIcon = await createTrayIconFromSvg();
|
||||
}
|
||||
trayIcon = await createTrayIconFromSvg(); // generate icon once on tray activation
|
||||
|
||||
const dispose = autorun(() => {
|
||||
const menu = createTrayMenu(windowManager);
|
||||
buildTray(trayIcon, menu);
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user