1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/main/electron-app/runnables/dock-visibility/show-dock-for-first-opened-window.injectable.ts
Sebastian Malton f178cf05eb Make Runnable and RunnableSync require ids
- Allows for better error messages related to mismatched runAfter's so
  that mismatched injection tokens are easy to fix

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2022-10-03 08:23:06 -04:00

27 lines
834 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 electronAppInjectable from "../../electron-app.injectable";
import { afterWindowIsOpenedInjectionToken } from "../../../start-main-application/runnable-tokens/after-window-is-opened-injection-token";
const showDockForFirstOpenedWindowInjectable = getInjectable({
id: "show-dock-for-first-opened-window",
instantiate: (di) => {
const app = di.inject(electronAppInjectable);
return {
id: "show-dock-for-first-opened-window",
run: () => {
app.dock?.show();
},
};
},
injectionToken: afterWindowIsOpenedInjectionToken,
});
export default showDockForFirstOpenedWindowInjectable;