1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/renderer/before-frame-starts/runnables/load-monaco-themes.injectable.ts
Sebastian Malton c7ead83425 Fix crash due to timing issues
- Make injectable phases more explicit for renderer

Signed-off-by: Sebastian Malton <sebastian@malton.name>
2022-12-19 08:17:26 -05:00

25 lines
899 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 { customMonacoThemeInjectionToken } from "../../components/monaco-editor";
import addNewMonacoThemeInjectable from "../../monaco/add-new-theme.injectable";
import { beforeFrameStartsSecondInjectionToken } from "../tokens";
const loadMonacoThemesInjectable = getInjectable({
id: "load-monaco-themes",
instantiate: (di) => ({
id: "load-monaco-themes",
run: () => {
const customThemes = di.injectMany(customMonacoThemeInjectionToken);
const addNewMonacoTheme = di.inject(addNewMonacoThemeInjectable);
customThemes.forEach(addNewMonacoTheme);
},
}),
injectionToken: beforeFrameStartsSecondInjectionToken,
});
export default loadMonacoThemesInjectable;