1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix lint again

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-03-01 11:07:01 -05:00
parent a3a705c90a
commit 23a0465b7b

View File

@ -3,10 +3,8 @@
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getInjectable } from "@ogre-tools/injectable"; import { getInjectable } from "@ogre-tools/injectable";
import { once } from "lodash";
import prefixedLoggerInjectable from "../../../common/logger/prefixed-logger.injectable"; import prefixedLoggerInjectable from "../../../common/logger/prefixed-logger.injectable";
import clusterFrameClusterInjectable from "../../cluster-frame-context/cluster-frame-cluster.injectable"; import clusterFrameClusterInjectable from "../../cluster-frame-context/cluster-frame-cluster.injectable";
import closeRendererLogFileInjectable from "../../logger/close-renderer-log-file.injectable";
import unmountRootComponentInjectable from "../../window/unmount-root-component.injectable"; import unmountRootComponentInjectable from "../../window/unmount-root-component.injectable";
const handleOnClusterFrameCloseInjectable = getInjectable({ const handleOnClusterFrameCloseInjectable = getInjectable({
@ -14,18 +12,13 @@ const handleOnClusterFrameCloseInjectable = getInjectable({
instantiate: (di) => { instantiate: (di) => {
const cluster = di.inject(clusterFrameClusterInjectable); const cluster = di.inject(clusterFrameClusterInjectable);
const logger = di.inject(prefixedLoggerInjectable, "CLUSTER-FRAME"); const logger = di.inject(prefixedLoggerInjectable, "CLUSTER-FRAME");
const closeFileLogging = di.inject(closeRendererLogFileInjectable);
const unmountRootComponent = di.inject(unmountRootComponentInjectable); const unmountRootComponent = di.inject(unmountRootComponentInjectable);
const onCloseFrame = once(() => {
logger.info(`Unload dashboard, clusterId=${(cluster.id)}`);
closeFileLogging();
unmountRootComponent();
});
return () => { return () => {
window.addEventListener("beforeunload", onCloseFrame); window.addEventListener("beforeunload", () => {
window.addEventListener("pagehide", onCloseFrame); logger.info(`Unload dashboard, clusterId=${(cluster.id)}`);
unmountRootComponent();
});
}; };
}, },
causesSideEffects: true, causesSideEffects: true,