mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Stop trying to restart catalog sync and updating of application when reloading window (#5735)
This commit is contained in:
parent
7ab3d419b3
commit
5d76dd4fc2
@ -16,7 +16,7 @@ const startCheckingForUpdatesInjectable = getInjectable({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
run: async () => {
|
run: async () => {
|
||||||
if (updatingIsEnabled) {
|
if (updatingIsEnabled && !periodicalCheckForUpdates.started) {
|
||||||
await periodicalCheckForUpdates.start();
|
await periodicalCheckForUpdates.start();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -14,7 +14,9 @@ const startCatalogSyncInjectable = getInjectable({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
run: async () => {
|
run: async () => {
|
||||||
|
if (!catalogSyncToRenderer.started) {
|
||||||
await catalogSyncToRenderer.start();
|
await catalogSyncToRenderer.start();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
@ -37,7 +37,6 @@ import lensResourcesDirInjectable from "../common/vars/lens-resources-dir.inject
|
|||||||
import environmentVariablesInjectable from "../common/utils/environment-variables.injectable";
|
import environmentVariablesInjectable from "../common/utils/environment-variables.injectable";
|
||||||
import setupIpcMainHandlersInjectable from "./electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.injectable";
|
import setupIpcMainHandlersInjectable from "./electron-app/runnables/setup-ipc-main-handlers/setup-ipc-main-handlers.injectable";
|
||||||
import setupLensProxyInjectable from "./start-main-application/runnables/setup-lens-proxy.injectable";
|
import setupLensProxyInjectable from "./start-main-application/runnables/setup-lens-proxy.injectable";
|
||||||
import setupRunnablesForAfterRootFrameIsReadyInjectable from "./start-main-application/runnables/setup-runnables-for-after-root-frame-is-ready.injectable";
|
|
||||||
import setupSentryInjectable from "./start-main-application/runnables/setup-sentry.injectable";
|
import setupSentryInjectable from "./start-main-application/runnables/setup-sentry.injectable";
|
||||||
import setupShellInjectable from "./start-main-application/runnables/setup-shell.injectable";
|
import setupShellInjectable from "./start-main-application/runnables/setup-shell.injectable";
|
||||||
import setupSyncingOfWeblinksInjectable from "./start-main-application/runnables/setup-syncing-of-weblinks.injectable";
|
import setupSyncingOfWeblinksInjectable from "./start-main-application/runnables/setup-syncing-of-weblinks.injectable";
|
||||||
@ -212,7 +211,6 @@ const overrideRunnablesHavingSideEffects = (di: DiContainer) => {
|
|||||||
initializeExtensionsInjectable,
|
initializeExtensionsInjectable,
|
||||||
setupIpcMainHandlersInjectable,
|
setupIpcMainHandlersInjectable,
|
||||||
setupLensProxyInjectable,
|
setupLensProxyInjectable,
|
||||||
setupRunnablesForAfterRootFrameIsReadyInjectable,
|
|
||||||
setupSentryInjectable,
|
setupSentryInjectable,
|
||||||
setupShellInjectable,
|
setupShellInjectable,
|
||||||
setupSyncingOfWeblinksInjectable,
|
setupSyncingOfWeblinksInjectable,
|
||||||
|
|||||||
@ -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;
|
|
||||||
Loading…
Reference in New Issue
Block a user