mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Renderer file logging still caused UI freezing (at least on apple silicon macs) when cluster frame was open and main frame was reloaded.
See #544
This reverts commit ac2d0e46ff.
Signed-off-by: Sami Tiilikainen <97873007+samitiilikainen@users.noreply.github.com>
This commit is contained in:
1 parent
c174965708
commit
ec81af4e6c
8 files changed
+14
-105
No files matched your search
-2
@@ -12,7 +12,6 @@ import emitAppEventInjectable from "../../../../common/app-event-bus/emit-event.
|
||||
import loadExtensionsInjectable from "../../load-extensions.injectable";
|
||||
import loggerInjectable from "../../../../common/logger.injectable";
|
||||
import showErrorNotificationInjectable from "../../../components/notifications/show-error-notification.injectable";
|
||||
import closeRendererLogFileInjectable from "../../../logger/close-renderer-log-file.injectable";
|
||||
|
||||
const initClusterFrameInjectable = getInjectable({
|
||||
id: "init-cluster-frame",
|
||||
@@ -30,7 +29,6 @@ const initClusterFrameInjectable = getInjectable({
|
||||
emitAppEvent: di.inject(emitAppEventInjectable),
|
||||
logger: di.inject(loggerInjectable),
|
||||
showErrorNotification: di.inject(showErrorNotificationInjectable),
|
||||
closeFileLogging: di.inject(closeRendererLogFileInjectable),
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
+3
-9
@@ -2,7 +2,6 @@
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { once } from "lodash";
|
||||
import type { Cluster } from "../../../../common/cluster/cluster";
|
||||
import type { CatalogEntityRegistry } from "../../../api/catalog/entity/registry";
|
||||
import type { ShowNotification } from "../../../components/notifications";
|
||||
@@ -19,7 +18,6 @@ interface Dependencies {
|
||||
emitAppEvent: EmitAppEvent;
|
||||
logger: Logger;
|
||||
showErrorNotification: ShowNotification;
|
||||
closeFileLogging: () => void;
|
||||
}
|
||||
|
||||
const logPrefix = "[CLUSTER-FRAME]:";
|
||||
@@ -32,7 +30,6 @@ export const initClusterFrame = ({
|
||||
emitAppEvent,
|
||||
logger,
|
||||
showErrorNotification,
|
||||
closeFileLogging,
|
||||
}: Dependencies) =>
|
||||
async (unmountRoot: () => void) => {
|
||||
// TODO: Make catalogEntityRegistry already initialized when passed as dependency
|
||||
@@ -76,14 +73,11 @@ export const initClusterFrame = ({
|
||||
});
|
||||
});
|
||||
|
||||
const onCloseFrame = once(() => {
|
||||
window.onbeforeunload = () => {
|
||||
logger.info(
|
||||
`${logPrefix} Unload dashboard, clusterId=${(hostedCluster.id)}, frameId=${frameRoutingId}`,
|
||||
);
|
||||
closeFileLogging();
|
||||
unmountRoot();
|
||||
});
|
||||
|
||||
window.addEventListener("beforeunload", onCloseFrame);
|
||||
window.addEventListener("pagehide", onCloseFrame);
|
||||
unmountRoot();
|
||||
};
|
||||
};
|
||||
@@ -13,7 +13,6 @@ import loggerInjectable from "../../../common/logger.injectable";
|
||||
import { delay } from "../../../common/utils";
|
||||
import { broadcastMessage } from "../../../common/ipc";
|
||||
import { bundledExtensionsLoaded } from "../../../common/ipc/extension-handling";
|
||||
import closeRendererLogFileInjectable from "../../logger/close-renderer-log-file.injectable";
|
||||
|
||||
const initRootFrameInjectable = getInjectable({
|
||||
id: "init-root-frame",
|
||||
@@ -25,7 +24,6 @@ const initRootFrameInjectable = getInjectable({
|
||||
const lensProtocolRouterRenderer = di.inject(lensProtocolRouterRendererInjectable);
|
||||
const catalogEntityRegistry = di.inject(catalogEntityRegistryInjectable);
|
||||
const logger = di.inject(loggerInjectable);
|
||||
const closeRendererLogFile = di.inject(closeRendererLogFileInjectable);
|
||||
|
||||
return async (unmountRoot: () => void) => {
|
||||
catalogEntityRegistry.init();
|
||||
@@ -61,7 +59,7 @@ const initRootFrameInjectable = getInjectable({
|
||||
|
||||
window.addEventListener("beforeunload", () => {
|
||||
logger.info("[ROOT-FRAME]: Unload app");
|
||||
closeRendererLogFile();
|
||||
|
||||
unmountRoot();
|
||||
});
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user