mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove import time side-effect causing memory leak
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
7ec64bff27
commit
c523e301d4
@ -3,7 +3,6 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { injectSystemCAs } from "../../../common/system-ca";
|
||||
import React from "react";
|
||||
import { Observer } from "mobx-react";
|
||||
import { withInjectables } from "@ogre-tools/injectable-react";
|
||||
@ -11,9 +10,6 @@ import broadcastThatRootFrameIsRenderedInjectable from "./broadcast-that-root-fr
|
||||
import type { RootFrameChildComponent } from "./root-frame-child-component-injection-token";
|
||||
import { rootFrameChildComponentInjectionToken } from "./root-frame-child-component-injection-token";
|
||||
|
||||
// Todo: remove import-time side-effect.
|
||||
injectSystemCAs();
|
||||
|
||||
interface Dependencies {
|
||||
broadcastThatRootFrameIsRendered: () => void;
|
||||
childComponents: RootFrameChildComponent[];
|
||||
|
||||
23
src/renderer/frames/root-frame/setup-system-ca.injectable.ts
Normal file
23
src/renderer/frames/root-frame/setup-system-ca.injectable.ts
Normal file
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { injectSystemCAs } from "../../../common/system-ca";
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { beforeFrameStartsInjectionToken } from "../../before-frame-starts/before-frame-starts-injection-token";
|
||||
|
||||
const setupSystemCaInjectable = getInjectable({
|
||||
id: "setup-system-ca",
|
||||
|
||||
instantiate: () => ({
|
||||
run: async () => {
|
||||
await injectSystemCAs();
|
||||
},
|
||||
}),
|
||||
|
||||
causesSideEffects: true,
|
||||
|
||||
injectionToken: beforeFrameStartsInjectionToken,
|
||||
});
|
||||
|
||||
export default setupSystemCaInjectable;
|
||||
@ -68,6 +68,7 @@ import deleteClusterDialogClusterFrameChildComponentInjectable from "./component
|
||||
import kubeObjectDetailsClusterFrameChildComponentInjectable from "./components/kube-object-details/kube-object-details-cluster-frame-child-component.injectable";
|
||||
import kubeconfigDialogClusterFrameChildComponentInjectable from "./components/kubeconfig-dialog/kubeconfig-dialog-cluster-frame-child-component.injectable";
|
||||
import portForwardDialogClusterFrameChildComponentInjectable from "./port-forward/port-forward-dialog-cluster-frame-child-component.injectable";
|
||||
import setupSystemCaInjectable from "./frames/root-frame/setup-system-ca.injectable";
|
||||
|
||||
export const getDiForUnitTesting = (opts: { doGeneralOverrides?: boolean } = {}) => {
|
||||
const {
|
||||
@ -171,6 +172,7 @@ export const getDiForUnitTesting = (opts: { doGeneralOverrides?: boolean } = {})
|
||||
// eslint-disable-next-line unused-imports/no-unused-vars-ts
|
||||
di.override(clusterStoreInjectable, () => ({ getById: (id): Cluster => ({}) as Cluster }) as ClusterStore);
|
||||
|
||||
di.override(setupSystemCaInjectable, () => ({ run: () => {} }));
|
||||
di.override(setupOnApiErrorListenersInjectable, () => ({ run: () => {} }));
|
||||
di.override(provideInitialValuesForSyncBoxesInjectable, () => ({ run: () => {} }));
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user