mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix hangup on application start by auto-registering more injectables
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com> Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
b4a1c2af9f
commit
f3d45ea78b
@ -20,15 +20,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { createContainer } from "@ogre-tools/injectable";
|
import { createContainer } from "@ogre-tools/injectable";
|
||||||
import type { ConfigurableDependencyInjectionContainer } from "@ogre-tools/injectable";
|
|
||||||
import { setDiKludge } from "../../common/di-kludge/di-kludge";
|
import { setDiKludge } from "../../common/di-kludge/di-kludge";
|
||||||
|
|
||||||
export const getDi = () => {
|
export const getDi = () => {
|
||||||
const di: ConfigurableDependencyInjectionContainer = createContainer(
|
const di = createContainer(
|
||||||
() => require.context("./", true, /\.injectable\.(ts|tsx)$/),
|
getRequireContextForRendererCode,
|
||||||
|
getRequireContextForCommonExtensionCode,
|
||||||
);
|
);
|
||||||
|
|
||||||
setDiKludge(di);
|
setDiKludge(di);
|
||||||
|
|
||||||
return di;
|
return di;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getRequireContextForRendererCode = () =>
|
||||||
|
require.context("./", true, /\.injectable\.(ts|tsx)$/);
|
||||||
|
|
||||||
|
const getRequireContextForCommonExtensionCode = () =>
|
||||||
|
require.context("../../extensions", true, /\.injectable\.(ts|tsx)$/);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user