1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/main/catalog-sync-to-renderer/start-catalog-sync.injectable.ts

28 lines
878 B
TypeScript

/**
* 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 { afterRootFrameIsReadyInjectionToken } from "../start-main-application/runnable-tokens/after-root-frame-is-ready-injection-token";
import catalogSyncToRendererInjectable from "./catalog-sync-to-renderer.injectable";
const startCatalogSyncInjectable = getInjectable({
id: "start-catalog-sync",
instantiate: (di) => {
const catalogSyncToRenderer = di.inject(catalogSyncToRendererInjectable);
return {
run: async () => {
if (!catalogSyncToRenderer.started) {
await catalogSyncToRenderer.start();
}
},
};
},
injectionToken: afterRootFrameIsReadyInjectionToken,
});
export default startCatalogSyncInjectable;