Stop trying to restart catalog sync and updating of application when reloading window (#5735)

This commit is contained in:
Janne Savolainen authored and GitHub committed 2022-06-29 08:22:08 -04:00
1 parent 7ab3d419b3
commit 5d76dd4fc2
4 files changed
+4 -41

No files matched your search

@@ -1,37 +0,0 @@
/**
* 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 { ipcMainOn } from "../../../common/ipc";
import { IpcRendererNavigationEvents } from "../../../renderer/navigation/events";
import { afterRootFrameIsReadyInjectionToken } from "../runnable-tokens/after-root-frame-is-ready-injection-token";
import { runManyFor } from "../../../common/runnable/run-many-for";
import { onLoadOfApplicationInjectionToken } from "../runnable-tokens/on-load-of-application-injection-token";
const setupRunnablesForAfterRootFrameIsReadyInjectable = getInjectable({
id: "setup-runnables-for-after-root-frame-is-ready",
instantiate: (di) => {
const runMany = runManyFor(di);
const runRunnablesAfterRootFrameIsReady = runMany(
afterRootFrameIsReadyInjectionToken,
);
return {
run: () => {
ipcMainOn(IpcRendererNavigationEvents.LOADED, async () => {
await runRunnablesAfterRootFrameIsReady();
});
},
};
},
// Direct usage of IPC
causesSideEffects: true,
injectionToken: onLoadOfApplicationInjectionToken,
});
export default setupRunnablesForAfterRootFrameIsReadyInjectable;