diff --git a/packages/core/src/features/application-menu/main/stop-application-menu.injectable.ts b/packages/core/src/features/application-menu/main/stop-application-menu.injectable.ts index 86d6072728..a293bb6866 100644 --- a/packages/core/src/features/application-menu/main/stop-application-menu.injectable.ts +++ b/packages/core/src/features/application-menu/main/stop-application-menu.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import applicationMenuReactivityInjectable from "./application-menu-reactivity.injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../../main/start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../../../main/start-main-application/runnable-tokens/phases"; const stopApplicationMenuInjectable = getInjectable({ id: "stop-application-menu", @@ -17,7 +17,7 @@ const stopApplicationMenuInjectable = getInjectable({ }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default stopApplicationMenuInjectable; diff --git a/packages/core/src/features/application-update/child-features/periodical-checking-of-updates/main/stop-checking-for-updates.injectable.ts b/packages/core/src/features/application-update/child-features/periodical-checking-of-updates/main/stop-checking-for-updates.injectable.ts index c8533fc311..7b6b83b031 100644 --- a/packages/core/src/features/application-update/child-features/periodical-checking-of-updates/main/stop-checking-for-updates.injectable.ts +++ b/packages/core/src/features/application-update/child-features/periodical-checking-of-updates/main/stop-checking-for-updates.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import periodicalCheckForUpdatesInjectable from "./periodical-check-for-updates.injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../../../../main/start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../../../../../main/start-main-application/runnable-tokens/phases"; const stopCheckingForUpdatesInjectable = getInjectable({ id: "stop-checking-for-updates", @@ -19,7 +19,7 @@ const stopCheckingForUpdatesInjectable = getInjectable({ }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default stopCheckingForUpdatesInjectable; diff --git a/packages/core/src/features/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts b/packages/core/src/features/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts index 86dd12682e..e8133e12d8 100644 --- a/packages/core/src/features/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts +++ b/packages/core/src/features/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import watchIfUpdateShouldHappenOnQuitInjectable from "./watch-if-update-should-happen-on-quit.injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../../../main/start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../../../../main/start-main-application/runnable-tokens/phases"; const stopWatchingIfUpdateShouldHappenOnQuitInjectable = getInjectable({ id: "stop-watching-if-update-should-happen-on-quit", @@ -17,7 +17,7 @@ const stopWatchingIfUpdateShouldHappenOnQuitInjectable = getInjectable({ }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default stopWatchingIfUpdateShouldHappenOnQuitInjectable; diff --git a/packages/core/src/features/extensions/stopping/main/stop-all.injectable.ts b/packages/core/src/features/extensions/stopping/main/stop-all.injectable.ts index 50400ee6d2..db0bf6be7b 100644 --- a/packages/core/src/features/extensions/stopping/main/stop-all.injectable.ts +++ b/packages/core/src/features/extensions/stopping/main/stop-all.injectable.ts @@ -5,7 +5,7 @@ import { getInjectable } from "@ogre-tools/injectable"; import extensionInjectable from "../../../../extensions/extension-loader/extension/extension.injectable"; import extensionsInjectable from "../../../../extensions/extensions.injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../../../main/start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../../../../main/start-main-application/runnable-tokens/phases"; const stopAllExtensionsInjectable = getInjectable({ id: "stop-all-extensions", @@ -21,7 +21,7 @@ const stopAllExtensionsInjectable = getInjectable({ } }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default stopAllExtensionsInjectable; diff --git a/packages/core/src/features/weblinks/main/stop-validating-weblinks.injectable.ts b/packages/core/src/features/weblinks/main/stop-validating-weblinks.injectable.ts index 96bc06647d..2c32f613c2 100644 --- a/packages/core/src/features/weblinks/main/stop-validating-weblinks.injectable.ts +++ b/packages/core/src/features/weblinks/main/stop-validating-weblinks.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../../main/start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../../../main/start-main-application/runnable-tokens/phases"; import weblinkVerificationStartableStoppableInjectable from "./weblink-verification.injectable"; const stopValidatingWeblinksInjectable = getInjectable({ @@ -15,7 +15,7 @@ const stopValidatingWeblinksInjectable = getInjectable({ weblinkVerificationStartableStoppable.stop(); }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default stopValidatingWeblinksInjectable; diff --git a/packages/core/src/main/electron-app/electron-app.global-override-for-injectable.ts b/packages/core/src/main/electron-app/electron-app.global-override-for-injectable.ts index 919303dd08..11a279fd11 100644 --- a/packages/core/src/main/electron-app/electron-app.global-override-for-injectable.ts +++ b/packages/core/src/main/electron-app/electron-app.global-override-for-injectable.ts @@ -6,16 +6,16 @@ import { kebabCase } from "lodash"; import { getGlobalOverride } from "@k8slens/test-utils"; import electronAppInjectable from "./electron-app.injectable"; +import EventEmitter from "events"; export default getGlobalOverride(electronAppInjectable, () => { const commandLineArgs: string[] = []; const chromiumArgs = new Map(); const appPaths = new Map(); - const app = ({ + const app = Object.assign(new EventEmitter(), { getVersion: () => "6.0.0", setLoginItemSettings: () => { }, - on: () => app, whenReady: async () => {}, getPath: (name) => appPaths.get(name) ?? `/some-directory-for-${kebabCase(name)}`, setPath: (name, value) => appPaths.set(name, value), diff --git a/packages/core/src/main/electron-app/features/is-explicitly-quitting.injectable.ts b/packages/core/src/main/electron-app/features/is-explicitly-quitting.injectable.ts new file mode 100644 index 0000000000..f80f2e3fa7 --- /dev/null +++ b/packages/core/src/main/electron-app/features/is-explicitly-quitting.injectable.ts @@ -0,0 +1,21 @@ +/** + * 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"; + +const isExplicitlyQuittingInjectable = getInjectable({ + id: "is-explicitly-quitting", + instantiate: () => { + let value = false; + + return { + get: () => value, + set: (newValue: boolean) => { + value = newValue; + }, + }; + }, +}); + +export default isExplicitlyQuittingInjectable; diff --git a/packages/core/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts b/packages/core/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts index 737562270b..da201f6ae6 100644 --- a/packages/core/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts +++ b/packages/core/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; import lensProtocolRouterMainInjectable from "../../protocol-handler/lens-protocol-router-main/lens-protocol-router-main.injectable"; const cleanUpDeepLinkingInjectable = getInjectable({ @@ -17,7 +17,7 @@ const cleanUpDeepLinkingInjectable = getInjectable({ }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default cleanUpDeepLinkingInjectable; diff --git a/packages/core/src/main/electron-app/runnables/setup-behaviour-when-last-window-closes.injectable.ts b/packages/core/src/main/electron-app/runnables/setup-behaviour-when-last-window-closes.injectable.ts new file mode 100644 index 0000000000..5fc00a5b2d --- /dev/null +++ b/packages/core/src/main/electron-app/runnables/setup-behaviour-when-last-window-closes.injectable.ts @@ -0,0 +1,39 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import { beforeElectronIsReadyInjectionToken } from "@k8slens/application-for-electron-main"; +import { runManySyncFor } from "@k8slens/run-many"; +import { getInjectable } from "@ogre-tools/injectable"; +import isIntegrationTestingInjectable from "../../../common/vars/is-integration-testing.injectable"; +import { afterQuitOfFrontEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; +import electronAppInjectable from "../electron-app.injectable"; +import quitAppInjectable from "../features/exit-app.injectable"; +import isAutoUpdatingInjectable from "../features/is-auto-updating.injectable"; + +const setupBehaviourWhenLastWindowClosesInjectable = getInjectable({ + id: "setupBehaviourWhenLastWindowCloses", + instantiate: (di) => ({ + run: () => { + const runManySync = runManySyncFor(di); + const runRunnablesAfterQuitOfFrontEnd = runManySync(afterQuitOfFrontEndInjectionToken); + const app = di.inject(electronAppInjectable); + const isIntegrationTesting = di.inject(isIntegrationTestingInjectable); + const quitApp = di.inject(quitAppInjectable); + const isAutoUpdating = di.inject(isAutoUpdatingInjectable); + + app.on("window-all-closed", () => { + runRunnablesAfterQuitOfFrontEnd(); + + if (isIntegrationTesting || isAutoUpdating.get()) { + quitApp(); + } + }); + + return undefined; + }, + }), + injectionToken: beforeElectronIsReadyInjectionToken, +}); + +export default setupBehaviourWhenLastWindowClosesInjectable; diff --git a/packages/core/src/main/electron-app/runnables/setup-cleanup-on-quit.injectable.ts b/packages/core/src/main/electron-app/runnables/setup-cleanup-on-quit.injectable.ts new file mode 100644 index 0000000000..7fceac7955 --- /dev/null +++ b/packages/core/src/main/electron-app/runnables/setup-cleanup-on-quit.injectable.ts @@ -0,0 +1,41 @@ +/** + * Copyright (c) OpenLens Authors. All rights reserved. + * Licensed under MIT License. See LICENSE in root directory for more information. + */ +import { beforeElectronIsReadyInjectionToken } from "@k8slens/application-for-electron-main"; +import { runManyFor } from "@k8slens/run-many"; +import { getInjectable } from "@ogre-tools/injectable"; +import { once } from "lodash"; +import { onQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; +import electronAppInjectable from "../electron-app.injectable"; + +const setupCleanupOnQuitOfApplicationInjectable = getInjectable({ + id: "setup-cleanup-on-quit-of-application", + instantiate: (di) => ({ + run: () => { + const runMany = runManyFor(di); + const runRunnablesBeforeQuitOfBackEnd = runMany(onQuitOfBackEndInjectionToken); + const app = di.inject(electronAppInjectable); + + const doAsyncQuit = once(() => void (async () => { + try { + await runRunnablesBeforeQuitOfBackEnd(); + app.exit(0); + } catch (error) { + console.error("A beforeQuitOfBackEnd failed!!!!", error); + app.exit(1); + } + })()); + + app.on("will-quit", (event) => { + event.preventDefault(); + doAsyncQuit(); + }); + + return undefined; + }, + }), + injectionToken: beforeElectronIsReadyInjectionToken, +}); + +export default setupCleanupOnQuitOfApplicationInjectable; diff --git a/packages/core/src/main/electron-app/runnables/setup-runnables-before-closing-of-application.injectable.ts b/packages/core/src/main/electron-app/runnables/setup-runnables-before-closing-of-application.injectable.ts deleted file mode 100644 index 2fbe1c0f27..0000000000 --- a/packages/core/src/main/electron-app/runnables/setup-runnables-before-closing-of-application.injectable.ts +++ /dev/null @@ -1,74 +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 { beforeElectronIsReadyInjectionToken } from "@k8slens/application-for-electron-main"; -import { afterQuitOfFrontEndInjectionToken, beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; -import electronAppInjectable from "../electron-app.injectable"; -import isIntegrationTestingInjectable from "../../../common/vars/is-integration-testing.injectable"; -import { runManySyncFor, runManyFor } from "@k8slens/run-many"; -import quitAppInjectable from "../features/exit-app.injectable"; - -const setupRunnablesBeforeClosingOfApplicationInjectable = getInjectable({ - id: "setup-closing-of-application", - - instantiate: (di) => ({ - run: () => { - const runManySync = runManySyncFor(di); - const runMany = runManyFor(di); - const runRunnablesAfterQuitOfFrontEnd = runManySync(afterQuitOfFrontEndInjectionToken); - const runRunnablesBeforeQuitOfBackEnd = runMany(beforeQuitOfBackEndInjectionToken); - const app = di.inject(electronAppInjectable); - const isIntegrationTesting = di.inject(isIntegrationTestingInjectable); - const quitApp = di.inject(quitAppInjectable); - - let isAsyncQuitting = false; - - const doAsyncQuit = () => { - if (isAsyncQuitting) { - return; - } - - isAsyncQuitting = true; - - void (async () => { - try { - console.log("before runRunnablesBeforeQuitOfBackEnd"); - await runRunnablesBeforeQuitOfBackEnd(); - console.log("after runRunnablesBeforeQuitOfBackEnd"); - app.exit(0); - } catch (error) { - console.error("A beforeQuitOfBackEnd failed!!!!", error); - app.exit(1); - } - })(); - }; - - app.on("window-all-closed", () => { - console.log(`app.on("window-all-closed")`); - runRunnablesAfterQuitOfFrontEnd(); - - if (isIntegrationTesting) { - quitApp(); - } - }); - - app.on("will-quit", (event) => { - console.log(`app.on("will-quit")`); - event.preventDefault(); - doAsyncQuit(); - }); - - app.on("quit", () => { - console.log(`app.on("quit")`); - }); - - return undefined; - }, - }), - - injectionToken: beforeElectronIsReadyInjectionToken, -}); - -export default setupRunnablesBeforeClosingOfApplicationInjectable; diff --git a/packages/core/src/main/lens-proxy/close-on-quit.injectable.ts b/packages/core/src/main/lens-proxy/close-on-quit.injectable.ts index 2ff22d6cf6..defa0d84f7 100644 --- a/packages/core/src/main/lens-proxy/close-on-quit.injectable.ts +++ b/packages/core/src/main/lens-proxy/close-on-quit.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../start-main-application/runnable-tokens/phases"; import lensProxyInjectable from "./lens-proxy.injectable"; const closeLensProxyOnQuitInjectable = getInjectable({ @@ -15,7 +15,7 @@ const closeLensProxyOnQuitInjectable = getInjectable({ await lensProxy.close(); }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default closeLensProxyOnQuitInjectable; diff --git a/packages/core/src/main/logger/close-file-transport-on-quit.injectable.ts b/packages/core/src/main/logger/close-file-transport-on-quit.injectable.ts index 4799f7bc4a..38a5fd6d3d 100644 --- a/packages/core/src/main/logger/close-file-transport-on-quit.injectable.ts +++ b/packages/core/src/main/logger/close-file-transport-on-quit.injectable.ts @@ -5,7 +5,7 @@ import { getInjectable } from "@ogre-tools/injectable"; import { loggerTransportInjectionToken } from "../../common/logger/transports"; import winstonLoggerInjectable from "../../common/winston-logger.injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../start-main-application/runnable-tokens/phases"; const closeLoggerOnQuitInjectable = getInjectable({ id: "close-file-transport-on-quit", @@ -21,7 +21,7 @@ const closeLoggerOnQuitInjectable = getInjectable({ } }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default closeLoggerOnQuitInjectable; diff --git a/packages/core/src/main/start-main-application/runnable-tokens/phases.ts b/packages/core/src/main/start-main-application/runnable-tokens/phases.ts index 4557477fc9..aff3a29906 100644 --- a/packages/core/src/main/start-main-application/runnable-tokens/phases.ts +++ b/packages/core/src/main/start-main-application/runnable-tokens/phases.ts @@ -10,8 +10,8 @@ export const afterQuitOfFrontEndInjectionToken = getInjectionToken id: "after-quit-of-front-end", }); -export const beforeQuitOfBackEndInjectionToken = getInjectionToken({ - id: "before-quit-of-back-end", +export const onQuitOfBackEndInjectionToken = getInjectionToken({ + id: "on-quit-of-back-end", }); export const afterWindowIsOpenedInjectionToken = getInjectionToken({ diff --git a/packages/core/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts b/packages/core/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts index 573a7b1597..f30c0f43d6 100644 --- a/packages/core/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts +++ b/packages/core/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../runnable-tokens/phases"; import shellSessionProcessesInjectable from "../../shell-session/processes.injectable"; import prefixedLoggerInjectable from "../../../common/logger/prefixed-logger.injectable"; @@ -29,7 +29,7 @@ const cleanUpShellSessionsInjectable = getInjectable({ }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default cleanUpShellSessionsInjectable; diff --git a/packages/core/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts b/packages/core/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts index f314aa52f4..0705db86fd 100644 --- a/packages/core/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts +++ b/packages/core/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../../runnable-tokens/phases"; import kubeconfigSyncManagerInjectable from "../../../catalog-sources/kubeconfig-sync/manager.injectable"; const stopKubeConfigSyncInjectable = getInjectable({ @@ -17,7 +17,7 @@ const stopKubeConfigSyncInjectable = getInjectable({ }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default stopKubeConfigSyncInjectable; diff --git a/packages/core/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts b/packages/core/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts index 5d75a70961..49c7592f5e 100644 --- a/packages/core/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts +++ b/packages/core/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import syncThemeFromOperatingSystemInjectable from "../../electron-app/features/sync-theme-from-operating-system.injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; const stopSyncingThemeFromOperatingSystemInjectable = getInjectable({ id: "stop-syncing-theme-from-operating-system", @@ -17,7 +17,7 @@ const stopSyncingThemeFromOperatingSystemInjectable = getInjectable({ }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default stopSyncingThemeFromOperatingSystemInjectable; diff --git a/packages/core/src/main/tray/electron-tray/stop-tray.injectable.ts b/packages/core/src/main/tray/electron-tray/stop-tray.injectable.ts index c45a0c91b4..f90fee4235 100644 --- a/packages/core/src/main/tray/electron-tray/stop-tray.injectable.ts +++ b/packages/core/src/main/tray/electron-tray/stop-tray.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import electronTrayInjectable from "./electron-tray.injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; import stopReactiveTrayMenuItemsInjectable from "../reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable"; const stopTrayInjectable = getInjectable({ @@ -19,7 +19,7 @@ const stopTrayInjectable = getInjectable({ runAfter: stopReactiveTrayMenuItemsInjectable, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default stopTrayInjectable; diff --git a/packages/core/src/main/tray/menu-icon/stop-reactivity.injectable.ts b/packages/core/src/main/tray/menu-icon/stop-reactivity.injectable.ts index f3bf252954..d5d5ccecc0 100644 --- a/packages/core/src/main/tray/menu-icon/stop-reactivity.injectable.ts +++ b/packages/core/src/main/tray/menu-icon/stop-reactivity.injectable.ts @@ -3,7 +3,7 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; import reactiveTrayMenuIconInjectable from "./reactive.injectable"; const stopReactiveTrayMenuIconInjectable = getInjectable({ @@ -17,7 +17,7 @@ const stopReactiveTrayMenuIconInjectable = getInjectable({ }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default stopReactiveTrayMenuIconInjectable; diff --git a/packages/core/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts b/packages/core/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts index 07b088c29e..44768eab1f 100644 --- a/packages/core/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts +++ b/packages/core/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts @@ -4,7 +4,7 @@ */ import { getInjectable } from "@ogre-tools/injectable"; import reactiveTrayMenuItemsInjectable from "./reactive-tray-menu-items.injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; +import { onQuitOfBackEndInjectionToken } from "../../start-main-application/runnable-tokens/phases"; const stopReactiveTrayMenuItemsInjectable = getInjectable({ id: "stop-reactive-tray-menu-items", @@ -17,7 +17,7 @@ const stopReactiveTrayMenuItemsInjectable = getInjectable({ }, }), - injectionToken: beforeQuitOfBackEndInjectionToken, + injectionToken: onQuitOfBackEndInjectionToken, }); export default stopReactiveTrayMenuItemsInjectable;