mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
- Allows for better error messages related to mismatched runAfter's so that mismatched injection tokens are easy to fix Signed-off-by: Sebastian Malton <sebastian@malton.name>
29 lines
901 B
TypeScript
29 lines
901 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 catalogSyncToRendererInjectable from "./catalog-sync-to-renderer.injectable";
|
|
import { beforeQuitOfFrontEndInjectionToken } from "../start-main-application/runnable-tokens/before-quit-of-front-end-injection-token";
|
|
|
|
const stopCatalogSyncInjectable = getInjectable({
|
|
id: "stop-catalog-sync",
|
|
|
|
instantiate: (di) => {
|
|
const catalogSyncToRenderer = di.inject(catalogSyncToRendererInjectable);
|
|
|
|
return {
|
|
id: "stop-catalog-sync",
|
|
run: async () => {
|
|
if (catalogSyncToRenderer.started) {
|
|
await catalogSyncToRenderer.stop();
|
|
}
|
|
},
|
|
};
|
|
},
|
|
|
|
injectionToken: beforeQuitOfFrontEndInjectionToken,
|
|
});
|
|
|
|
export default stopCatalogSyncInjectable;
|