mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Remove the auto-update status bar item for not being needed anymore Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Make adding of new tray icons easier by complying to Open Closed Principle Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Start showing different tray icon when checking for updates Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Include placeholder icon for checking for updates Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Simplify code Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add first keyframe for downloading spinner Signed-off-by: Sebastian Malton <sebastian@malton.name> Co-authored-by: Sebastian Malton <sebastian@malton.name>
33 lines
1017 B
TypeScript
33 lines
1017 B
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
import { getInjectable } from "@ogre-tools/injectable";
|
|
import { reaction } from "mobx";
|
|
import { getStartableStoppable } from "../../../common/utils/get-startable-stoppable";
|
|
import electronTrayInjectable from "../electron-tray/electron-tray.injectable";
|
|
import trayIconInjectable from "./tray-icon.injectable";
|
|
|
|
const reactiveTrayMenuIconInjectable = getInjectable({
|
|
id: "reactive-tray-menu-icon",
|
|
|
|
instantiate: (di) => {
|
|
const trayMenuIcon = di.inject(trayIconInjectable);
|
|
const electronTray = di.inject(electronTrayInjectable);
|
|
|
|
return getStartableStoppable("reactive-tray-menu-icon", () => (
|
|
reaction(
|
|
() => trayMenuIcon.get(),
|
|
icon => {
|
|
electronTray.setIconPath(icon.iconPath);
|
|
},
|
|
{
|
|
fireImmediately: true,
|
|
},
|
|
)
|
|
));
|
|
},
|
|
});
|
|
|
|
export default reactiveTrayMenuIconInjectable;
|