1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/features/application-update/child-features/periodical-checking-of-updates/main/stop-checking-for-updates.injectable.ts
Sebastian Malton 404dcabe3a Convert all sync runnables to comply with new checks for sync-ness
Signed-off-by: Sebastian Malton <sebastian@malton.name>
2022-11-07 11:13:01 -05:00

31 lines
984 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 periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.injectable";
import { beforeQuitOfBackEndInjectionToken } from "../../../../../main/start-main-application/runnable-tokens/before-quit-of-back-end-injection-token";
const stopCheckingForUpdatesInjectable = getInjectable({
id: "stop-checking-for-updates",
instantiate: (di) => {
const periodicalCheckForUpdates = di.inject(periodicalCheckForUpdatesInjectable);
return {
id: "stop-checking-for-updates",
run: () => {
if (periodicalCheckForUpdates.started) {
periodicalCheckForUpdates.stop();
}
return undefined;
},
};
},
injectionToken: beforeQuitOfBackEndInjectionToken,
});
export default stopCheckingForUpdatesInjectable;