From 404dcabe3a68a1a1aee9ccc27eb28aeac81e0f5a Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 7 Nov 2022 11:13:01 -0500 Subject: [PATCH] Convert all sync runnables to comply with new checks for sync-ness Signed-off-by: Sebastian Malton --- .../application-menu-reactivity.injectable.ts | 5 +++-- .../main/stop-application-menu.injectable.ts | 8 ++----- ...periodical-check-for-updates.injectable.ts | 5 ++--- .../stop-checking-for-updates.injectable.ts | 6 +++-- ...update-should-happen-on-quit.injectable.ts | 4 +--- .../app-paths/setup-app-paths.injectable.ts | 3 +++ .../catalog-sync-to-renderer.injectable.ts | 5 +++-- .../stop-catalog-sync.injectable.ts | 6 +++-- ...-theme-from-operating-system.injectable.ts | 4 +--- .../clean-up-deep-linking.injectable.ts | 4 +--- ...-dock-for-last-closed-window.injectable.ts | 2 ++ ...-single-application-instance.injectable.ts | 2 ++ .../setup-application-name.injectable.ts | 2 ++ ...ables-after-window-is-opened.injectable.ts | 7 +++--- ...efore-closing-of-application.injectable.ts | 22 +++++++------------ ...efore-electron-is-ready-injection-token.ts | 7 +++--- ...before-quit-of-back-end-injection-token.ts | 7 +++--- ...efore-quit-of-front-end-injection-token.ts | 7 +++--- .../clean-up-shell-sessions.injectable.ts | 4 +--- .../emit-close-to-event-bus.injectable.ts | 2 ++ .../flag-renderer-as-not-loaded.injectable.ts | 2 ++ .../stop-kube-config-sync.injectable.ts | 4 +--- .../runnables/sentry/setup.injectable.ts | 2 +- .../setup-hardware-acceleration.injectable.ts | 2 ++ .../runnables/setup-immer.injectable.ts | 2 ++ .../runnables/setup-mobx.injectable.ts | 2 ++ .../runnables/setup-proxy-env.injectable.ts | 2 ++ .../stop-cluster-manager.injectable.ts | 4 ++-- ...op-broadcasting-theme-change.injectable.ts | 4 +--- ...-theme-from-operating-system.injectable.ts | 4 +--- .../electron-tray/stop-tray.injectable.ts | 5 +---- .../menu-icon/stop-reactivity.injectable.ts | 4 +--- .../reactive-tray-menu-items.injectable.ts | 4 +--- ...top-reactive-tray-menu-items.injectable.ts | 4 +--- .../start-listening-on-channels.injectable.ts | 6 ++--- 35 files changed, 76 insertions(+), 87 deletions(-) diff --git a/src/features/application-menu/main/application-menu-reactivity.injectable.ts b/src/features/application-menu/main/application-menu-reactivity.injectable.ts index 67631322aa..80bfd108fd 100644 --- a/src/features/application-menu/main/application-menu-reactivity.injectable.ts +++ b/src/features/application-menu/main/application-menu-reactivity.injectable.ts @@ -15,8 +15,9 @@ const applicationMenuReactivityInjectable = getInjectable({ const applicationMenuItemComposite = di.inject(applicationMenuItemCompositeInjectable); const populateApplicationMenu = di.inject(populateApplicationMenuInjectable); - return getStartableStoppable("application-menu-reactivity", () => - autorun(() => populateApplicationMenu(applicationMenuItemComposite.get()), { + return getStartableStoppable( + "application-menu-reactivity", + () => autorun(() => populateApplicationMenu(applicationMenuItemComposite.get()), { delay: 100, }), ); diff --git a/src/features/application-menu/main/stop-application-menu.injectable.ts b/src/features/application-menu/main/stop-application-menu.injectable.ts index 63abccadf9..62abd439df 100644 --- a/src/features/application-menu/main/stop-application-menu.injectable.ts +++ b/src/features/application-menu/main/stop-application-menu.injectable.ts @@ -10,15 +10,11 @@ const stopApplicationMenuInjectable = getInjectable({ id: "stop-application-menu", instantiate: (di) => { - const applicationMenu = di.inject( - applicationMenuReactivityInjectable, - ); + const applicationMenu = di.inject(applicationMenuReactivityInjectable); return { id: "stop-application-menu", - run: async () => { - await applicationMenu.stop(); - }, + run: () => void applicationMenu.stop(), }; }, diff --git a/src/features/application-update/child-features/periodical-checking-of-updates/main/periodical-check-for-updates.injectable.ts b/src/features/application-update/child-features/periodical-checking-of-updates/main/periodical-check-for-updates.injectable.ts index 472cf31a06..85c687e478 100644 --- a/src/features/application-update/child-features/periodical-checking-of-updates/main/periodical-check-for-updates.injectable.ts +++ b/src/features/application-update/child-features/periodical-checking-of-updates/main/periodical-check-for-updates.injectable.ts @@ -7,6 +7,8 @@ import { getStartableStoppable } from "../../../../../common/utils/get-startable import processCheckingForUpdatesInjectable from "../../../main/process-checking-for-updates.injectable"; import withOrphanPromiseInjectable from "../../../../../common/utils/with-orphan-promise/with-orphan-promise.injectable"; +const TWO_HOURS = 1000 * 60 * 60 * 2; + const periodicalCheckForUpdatesInjectable = getInjectable({ id: "periodical-check-for-updates", @@ -15,12 +17,9 @@ const periodicalCheckForUpdatesInjectable = getInjectable({ const processCheckingForUpdates = withOrphanPromise(di.inject(processCheckingForUpdatesInjectable)); return getStartableStoppable("periodical-check-for-updates", () => { - const TWO_HOURS = 1000 * 60 * 60 * 2; - processCheckingForUpdates("periodic"); const intervalId = setInterval(() => { - processCheckingForUpdates("periodic"); }, TWO_HOURS); diff --git a/src/features/application-update/child-features/periodical-checking-of-updates/main/stop-checking-for-updates.injectable.ts b/src/features/application-update/child-features/periodical-checking-of-updates/main/stop-checking-for-updates.injectable.ts index ff7607e7db..6e58d7dd77 100644 --- a/src/features/application-update/child-features/periodical-checking-of-updates/main/stop-checking-for-updates.injectable.ts +++ b/src/features/application-update/child-features/periodical-checking-of-updates/main/stop-checking-for-updates.injectable.ts @@ -14,10 +14,12 @@ const stopCheckingForUpdatesInjectable = getInjectable({ return { id: "stop-checking-for-updates", - run: async () => { + run: () => { if (periodicalCheckForUpdates.started) { - await periodicalCheckForUpdates.stop(); + periodicalCheckForUpdates.stop(); } + + return undefined; }, }; }, diff --git a/src/features/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts b/src/features/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts index f68edacefb..faf67b4ffc 100644 --- a/src/features/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts +++ b/src/features/application-update/main/watch-if-update-should-happen-on-quit/stop-watching-if-update-should-happen-on-quit.injectable.ts @@ -14,9 +14,7 @@ const stopWatchingIfUpdateShouldHappenOnQuitInjectable = getInjectable({ return { id: "stop-watching-if-update-should-happen-on-quit", - run: () => { - watchIfUpdateShouldHappenOnQuit.stop(); - }, + run: () => void watchIfUpdateShouldHappenOnQuit.stop(), }; }, diff --git a/src/main/app-paths/setup-app-paths.injectable.ts b/src/main/app-paths/setup-app-paths.injectable.ts index 842eed89c7..54bc0ea2ba 100644 --- a/src/main/app-paths/setup-app-paths.injectable.ts +++ b/src/main/app-paths/setup-app-paths.injectable.ts @@ -44,6 +44,9 @@ const setupAppPathsInjectable = getInjectable({ ) as AppPaths; appPathsState.set(appPaths); + + // NOTE: this is the worse of two evils. This makes sure that `RunnableSync` always is sync + return undefined; }, }; }, diff --git a/src/main/catalog-sync-to-renderer/catalog-sync-to-renderer.injectable.ts b/src/main/catalog-sync-to-renderer/catalog-sync-to-renderer.injectable.ts index 7e588481a8..a9ba676bf9 100644 --- a/src/main/catalog-sync-to-renderer/catalog-sync-to-renderer.injectable.ts +++ b/src/main/catalog-sync-to-renderer/catalog-sync-to-renderer.injectable.ts @@ -13,8 +13,9 @@ const catalogSyncToRendererInjectable = getInjectable({ instantiate: (di) => { const catalogEntityRegistry = di.inject(catalogEntityRegistryInjectable); - return getStartableStoppable("catalog-sync", () => - startCatalogSyncToRenderer(catalogEntityRegistry), + return getStartableStoppable( + "catalog-sync", + () => startCatalogSyncToRenderer(catalogEntityRegistry), ); }, diff --git a/src/main/catalog-sync-to-renderer/stop-catalog-sync.injectable.ts b/src/main/catalog-sync-to-renderer/stop-catalog-sync.injectable.ts index fcd294fe02..353790d8b2 100644 --- a/src/main/catalog-sync-to-renderer/stop-catalog-sync.injectable.ts +++ b/src/main/catalog-sync-to-renderer/stop-catalog-sync.injectable.ts @@ -14,10 +14,12 @@ const stopCatalogSyncInjectable = getInjectable({ return { id: "stop-catalog-sync", - run: async () => { + run: () => { if (catalogSyncToRenderer.started) { - await catalogSyncToRenderer.stop(); + catalogSyncToRenderer.stop(); } + + return undefined; }, }; }, diff --git a/src/main/electron-app/features/sync-theme-from-operating-system.injectable.ts b/src/main/electron-app/features/sync-theme-from-operating-system.injectable.ts index fa2f8e335e..818bf938ec 100644 --- a/src/main/electron-app/features/sync-theme-from-operating-system.injectable.ts +++ b/src/main/electron-app/features/sync-theme-from-operating-system.injectable.ts @@ -18,9 +18,7 @@ const syncThemeFromOperatingSystemInjectable = getInjectable({ return getStartableStoppable("sync-theme-from-operating-system", () => { const updateThemeState = () => { - const newTheme = getElectronTheme(); - - currentThemeState.set(newTheme); + currentThemeState.set(getElectronTheme()); }; nativeTheme.on("updated", updateThemeState); diff --git a/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts b/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts index 9943516f72..b5088a667a 100644 --- a/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts +++ b/src/main/electron-app/runnables/clean-up-deep-linking.injectable.ts @@ -14,9 +14,7 @@ const cleanUpDeepLinkingInjectable = getInjectable({ return { id: "clean-up-deep-linking", - run: () => { - lensProtocolRouterMain.cleanup(); - }, + run: () => void lensProtocolRouterMain.cleanup(), }; }, diff --git a/src/main/electron-app/runnables/dock-visibility/hide-dock-for-last-closed-window.injectable.ts b/src/main/electron-app/runnables/dock-visibility/hide-dock-for-last-closed-window.injectable.ts index d7fd4bdcb2..5586c93586 100644 --- a/src/main/electron-app/runnables/dock-visibility/hide-dock-for-last-closed-window.injectable.ts +++ b/src/main/electron-app/runnables/dock-visibility/hide-dock-for-last-closed-window.injectable.ts @@ -23,6 +23,8 @@ const hideDockForLastClosedWindowInjectable = getInjectable({ if (isEmpty(visibleWindows)) { app.dock?.hide(); } + + return undefined; }, }; }, diff --git a/src/main/electron-app/runnables/enforce-single-application-instance.injectable.ts b/src/main/electron-app/runnables/enforce-single-application-instance.injectable.ts index de192e3372..f69036ffed 100644 --- a/src/main/electron-app/runnables/enforce-single-application-instance.injectable.ts +++ b/src/main/electron-app/runnables/enforce-single-application-instance.injectable.ts @@ -20,6 +20,8 @@ const enforceSingleApplicationInstanceInjectable = getInjectable({ if (!requestSingleInstanceLock()) { exitApp(); } + + return undefined; }, }; }, diff --git a/src/main/electron-app/runnables/setup-application-name.injectable.ts b/src/main/electron-app/runnables/setup-application-name.injectable.ts index 8bafc3fe8b..fd47480f09 100644 --- a/src/main/electron-app/runnables/setup-application-name.injectable.ts +++ b/src/main/electron-app/runnables/setup-application-name.injectable.ts @@ -18,6 +18,8 @@ const setupApplicationNameInjectable = getInjectable({ id: "setup-application-name", run: () => { app.setName(appName); + + return undefined; }, }; }, diff --git a/src/main/electron-app/runnables/setup-runnables-after-window-is-opened.injectable.ts b/src/main/electron-app/runnables/setup-runnables-after-window-is-opened.injectable.ts index 13650605fb..fe501d4750 100644 --- a/src/main/electron-app/runnables/setup-runnables-after-window-is-opened.injectable.ts +++ b/src/main/electron-app/runnables/setup-runnables-after-window-is-opened.injectable.ts @@ -13,15 +13,14 @@ const setupRunnablesAfterWindowIsOpenedInjectable = getInjectable({ instantiate: (di) => { const afterWindowIsOpened = runManyFor(di)(afterWindowIsOpenedInjectionToken); + const app = di.inject(electronAppInjectable); return { id: "setup-runnables-after-window-is-opened", run: () => { - const app = di.inject(electronAppInjectable); + app.on("browser-window-created", () => afterWindowIsOpened); - app.on("browser-window-created", async () => { - await afterWindowIsOpened(); - }); + return undefined; }, }; }, diff --git a/src/main/electron-app/runnables/setup-runnables-before-closing-of-application.injectable.ts b/src/main/electron-app/runnables/setup-runnables-before-closing-of-application.injectable.ts index 5e8b24c2d8..c0bc3ae620 100644 --- a/src/main/electron-app/runnables/setup-runnables-before-closing-of-application.injectable.ts +++ b/src/main/electron-app/runnables/setup-runnables-before-closing-of-application.injectable.ts @@ -15,24 +15,16 @@ const setupRunnablesBeforeClosingOfApplicationInjectable = getInjectable({ id: "setup-closing-of-application", instantiate: (di) => { - const runMany = runManySyncFor(di); - - const runRunnablesBeforeQuitOfFrontEnd = runMany( - beforeQuitOfFrontEndInjectionToken, - ); - - const runRunnablesBeforeQuitOfBackEnd = runMany( - beforeQuitOfBackEndInjectionToken, - ); + const runManySync = runManySyncFor(di); + const runRunnablesBeforeQuitOfFrontEnd = runManySync(beforeQuitOfFrontEndInjectionToken); + const runRunnablesBeforeQuitOfBackEnd = runManySync(beforeQuitOfBackEndInjectionToken); + const app = di.inject(electronAppInjectable); + const isIntegrationTesting = di.inject(isIntegrationTestingInjectable); + const autoUpdater = di.inject(autoUpdaterInjectable); return { id: "setup-closing-of-application", run: () => { - const app = di.inject(electronAppInjectable); - - const isIntegrationTesting = di.inject(isIntegrationTestingInjectable); - const autoUpdater = di.inject(autoUpdaterInjectable); - let isAutoUpdating = false; autoUpdater.on("before-quit-for-update", () => { @@ -51,6 +43,8 @@ const setupRunnablesBeforeClosingOfApplicationInjectable = getInjectable({ event.preventDefault(); } }); + + return undefined; }, }; }, diff --git a/src/main/start-main-application/runnable-tokens/before-electron-is-ready-injection-token.ts b/src/main/start-main-application/runnable-tokens/before-electron-is-ready-injection-token.ts index 08173ebef2..4bdef1ff90 100644 --- a/src/main/start-main-application/runnable-tokens/before-electron-is-ready-injection-token.ts +++ b/src/main/start-main-application/runnable-tokens/before-electron-is-ready-injection-token.ts @@ -5,7 +5,6 @@ import { getInjectionToken } from "@ogre-tools/injectable"; import type { RunnableSync } from "../../../common/runnable/run-many-sync-for"; -export const beforeElectronIsReadyInjectionToken = - getInjectionToken({ - id: "before-electron-is-ready", - }); +export const beforeElectronIsReadyInjectionToken = getInjectionToken({ + id: "before-electron-is-ready", +}); diff --git a/src/main/start-main-application/runnable-tokens/before-quit-of-back-end-injection-token.ts b/src/main/start-main-application/runnable-tokens/before-quit-of-back-end-injection-token.ts index bdb1d1e1be..d11ecf57d2 100644 --- a/src/main/start-main-application/runnable-tokens/before-quit-of-back-end-injection-token.ts +++ b/src/main/start-main-application/runnable-tokens/before-quit-of-back-end-injection-token.ts @@ -5,7 +5,6 @@ import { getInjectionToken } from "@ogre-tools/injectable"; import type { RunnableSync } from "../../../common/runnable/run-many-sync-for"; -export const beforeQuitOfBackEndInjectionToken = - getInjectionToken({ - id: "before-quit-of-back-end", - }); +export const beforeQuitOfBackEndInjectionToken = getInjectionToken({ + id: "before-quit-of-back-end", +}); diff --git a/src/main/start-main-application/runnable-tokens/before-quit-of-front-end-injection-token.ts b/src/main/start-main-application/runnable-tokens/before-quit-of-front-end-injection-token.ts index 2327688cb3..0a45a684cd 100644 --- a/src/main/start-main-application/runnable-tokens/before-quit-of-front-end-injection-token.ts +++ b/src/main/start-main-application/runnable-tokens/before-quit-of-front-end-injection-token.ts @@ -5,7 +5,6 @@ import { getInjectionToken } from "@ogre-tools/injectable"; import type { RunnableSync } from "../../../common/runnable/run-many-sync-for"; -export const beforeQuitOfFrontEndInjectionToken = - getInjectionToken({ - id: "before-quit-of-front-end", - }); +export const beforeQuitOfFrontEndInjectionToken = getInjectionToken({ + id: "before-quit-of-front-end", +}); diff --git a/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts b/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts index 40d50530ad..46afa5e692 100644 --- a/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts +++ b/src/main/start-main-application/runnables/clean-up-shell-sessions.injectable.ts @@ -11,9 +11,7 @@ const cleanUpShellSessionsInjectable = getInjectable({ instantiate: () => ({ id: "clean-up-shell-sessions", - run: () => { - ShellSession.cleanup(); - }, + run: () => void ShellSession.cleanup(), }), injectionToken: beforeQuitOfBackEndInjectionToken, diff --git a/src/main/start-main-application/runnables/emit-close-to-event-bus.injectable.ts b/src/main/start-main-application/runnables/emit-close-to-event-bus.injectable.ts index dc9c04771e..e1da8c1d67 100644 --- a/src/main/start-main-application/runnables/emit-close-to-event-bus.injectable.ts +++ b/src/main/start-main-application/runnables/emit-close-to-event-bus.injectable.ts @@ -16,6 +16,8 @@ const emitCloseToEventBusInjectable = getInjectable({ id: "emit-close-to-event-bus", run: () => { emitAppEvent({ name: "app", action: "close" }); + + return undefined; }, }; }, diff --git a/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-not-loaded.injectable.ts b/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-not-loaded.injectable.ts index 8b0a4b8161..d5f7444232 100644 --- a/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-not-loaded.injectable.ts +++ b/src/main/start-main-application/runnables/flag-renderer/flag-renderer-as-not-loaded.injectable.ts @@ -20,6 +20,8 @@ const flagRendererAsNotLoadedInjectable = getInjectable({ // Todo: remove this kludge which enables out-of-place temporal dependency. lensProtocolRouterMain.rendererLoaded = false; }); + + return undefined; }, }; }, diff --git a/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts b/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts index 77e987effc..4cb5a98a3f 100644 --- a/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts +++ b/src/main/start-main-application/runnables/kube-config-sync/stop-kube-config-sync.injectable.ts @@ -14,9 +14,7 @@ const stopKubeConfigSyncInjectable = getInjectable({ return { id: "stop-kube-config-sync", - run: () => { - kubeConfigSyncManager.stopSync(); - }, + run: () => void kubeConfigSyncManager.stopSync(), }; }, diff --git a/src/main/start-main-application/runnables/sentry/setup.injectable.ts b/src/main/start-main-application/runnables/sentry/setup.injectable.ts index 9db6991fea..6d4111ae78 100644 --- a/src/main/start-main-application/runnables/sentry/setup.injectable.ts +++ b/src/main/start-main-application/runnables/sentry/setup.injectable.ts @@ -15,7 +15,7 @@ const setupSentryInjectable = getInjectable({ return { id: "setup-sentry", - run: () => initializeSentryReportingWith(initializeSentryOnMain), + run: () => void initializeSentryReportingWith(initializeSentryOnMain), }; }, injectionToken: beforeElectronIsReadyInjectionToken, diff --git a/src/main/start-main-application/runnables/setup-hardware-acceleration.injectable.ts b/src/main/start-main-application/runnables/setup-hardware-acceleration.injectable.ts index cbb9b940cb..905cb9e130 100644 --- a/src/main/start-main-application/runnables/setup-hardware-acceleration.injectable.ts +++ b/src/main/start-main-application/runnables/setup-hardware-acceleration.injectable.ts @@ -20,6 +20,8 @@ const setupHardwareAccelerationInjectable = getInjectable({ if (hardwareAccelerationShouldBeDisabled) { disableHardwareAcceleration(); } + + return undefined; }, }; }, diff --git a/src/main/start-main-application/runnables/setup-immer.injectable.ts b/src/main/start-main-application/runnables/setup-immer.injectable.ts index 1d03bd8e9d..61420cf35b 100644 --- a/src/main/start-main-application/runnables/setup-immer.injectable.ts +++ b/src/main/start-main-application/runnables/setup-immer.injectable.ts @@ -16,6 +16,8 @@ const setupImmerInjectable = getInjectable({ // Required in `utils/storage-helper.ts` Immer.setAutoFreeze(false); // allow to merge mobx observables Immer.enableMapSet(); // allow to merge maps and sets + + return undefined; }, }), diff --git a/src/main/start-main-application/runnables/setup-mobx.injectable.ts b/src/main/start-main-application/runnables/setup-mobx.injectable.ts index 350911fecd..d13021cdc6 100644 --- a/src/main/start-main-application/runnables/setup-mobx.injectable.ts +++ b/src/main/start-main-application/runnables/setup-mobx.injectable.ts @@ -21,6 +21,8 @@ const setupMobxInjectable = getInjectable({ // reactionRequiresObservable: true, // observableRequiresReaction: true, }); + + return undefined; }, }), diff --git a/src/main/start-main-application/runnables/setup-proxy-env.injectable.ts b/src/main/start-main-application/runnables/setup-proxy-env.injectable.ts index bc709f1f72..0541c2cfda 100644 --- a/src/main/start-main-application/runnables/setup-proxy-env.injectable.ts +++ b/src/main/start-main-application/runnables/setup-proxy-env.injectable.ts @@ -34,6 +34,8 @@ const setupProxyEnvInjectable = getInjectable({ if (getCommandLineSwitch("proxy-server") !== "") { process.env.HTTPS_PROXY = getCommandLineSwitch("proxy-server"); } + + return undefined; }, }; }, diff --git a/src/main/start-main-application/runnables/stop-cluster-manager.injectable.ts b/src/main/start-main-application/runnables/stop-cluster-manager.injectable.ts index f8d6c0bdc7..c0a39c51ae 100644 --- a/src/main/start-main-application/runnables/stop-cluster-manager.injectable.ts +++ b/src/main/start-main-application/runnables/stop-cluster-manager.injectable.ts @@ -16,13 +16,13 @@ const stopClusterManagerInjectable = getInjectable({ id: "stop-cluster-manager", run: () => { clusterManager.stop(); + + return undefined; }, }; }, injectionToken: beforeQuitOfFrontEndInjectionToken, - - causesSideEffects: true, }); export default stopClusterManagerInjectable; diff --git a/src/main/theme/broadcast-theme-change/stop-broadcasting-theme-change.injectable.ts b/src/main/theme/broadcast-theme-change/stop-broadcasting-theme-change.injectable.ts index 81f530ad9b..ede38cb4f1 100644 --- a/src/main/theme/broadcast-theme-change/stop-broadcasting-theme-change.injectable.ts +++ b/src/main/theme/broadcast-theme-change/stop-broadcasting-theme-change.injectable.ts @@ -14,9 +14,7 @@ const stopBroadcastingThemeChangeInjectable = getInjectable({ return { id: "stop-broadcasting-theme-change", - run: async () => { - await broadcastThemeChange.stop(); - }, + run: () => void broadcastThemeChange.stop(), }; }, diff --git a/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts b/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts index 8a11042883..b45184a3bd 100644 --- a/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts +++ b/src/main/theme/sync-theme-from-os/stop-syncing-theme-from-operating-system.injectable.ts @@ -14,9 +14,7 @@ const stopSyncingThemeFromOperatingSystemInjectable = getInjectable({ return { id: "stop-syncing-theme-from-operating-system", - run: async () => { - await syncTheme.stop(); - }, + run: () => void syncTheme.stop(), }; }, diff --git a/src/main/tray/electron-tray/stop-tray.injectable.ts b/src/main/tray/electron-tray/stop-tray.injectable.ts index babf687772..d2e58be039 100644 --- a/src/main/tray/electron-tray/stop-tray.injectable.ts +++ b/src/main/tray/electron-tray/stop-tray.injectable.ts @@ -15,10 +15,7 @@ const stopTrayInjectable = getInjectable({ return { id: "stop-tray", - run: () => { - electronTray.stop(); - }, - + run: () => void electronTray.stop(), runAfter: di.inject(stopReactiveTrayMenuItemsInjectable), }; }, diff --git a/src/main/tray/menu-icon/stop-reactivity.injectable.ts b/src/main/tray/menu-icon/stop-reactivity.injectable.ts index b43661807d..94e91ec607 100644 --- a/src/main/tray/menu-icon/stop-reactivity.injectable.ts +++ b/src/main/tray/menu-icon/stop-reactivity.injectable.ts @@ -14,9 +14,7 @@ const stopReactiveTrayMenuIconInjectable = getInjectable({ return { id: "stop-reactive-tray-menu-icon", - run: async () => { - await reactiveTrayMenuIcon.stop(); - }, + run: () => void reactiveTrayMenuIcon.stop(), }; }, diff --git a/src/main/tray/reactive-tray-menu-items/reactive-tray-menu-items.injectable.ts b/src/main/tray/reactive-tray-menu-items/reactive-tray-menu-items.injectable.ts index 145cc1e870..378bceafd9 100644 --- a/src/main/tray/reactive-tray-menu-items/reactive-tray-menu-items.injectable.ts +++ b/src/main/tray/reactive-tray-menu-items/reactive-tray-menu-items.injectable.ts @@ -19,10 +19,8 @@ const reactiveTrayMenuItemsInjectable = getInjectable({ return getStartableStoppable("reactive-tray-menu-items", () => reaction( - (): MinimalTrayMenuItem[] => reactiveItems.get().map(toNonReactiveItem), - + () => reactiveItems.get().map(toNonReactiveItem), (nonReactiveItems) => electronTray.setMenuItems(nonReactiveItems), - { fireImmediately: true, }, diff --git a/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts b/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts index dbf5753c23..122e9c059a 100644 --- a/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts +++ b/src/main/tray/reactive-tray-menu-items/stop-reactive-tray-menu-items.injectable.ts @@ -14,9 +14,7 @@ const stopReactiveTrayMenuItemsInjectable = getInjectable({ return { id: "stop-reactive-tray-menu-items", - run: async () => { - await reactiveTrayMenuItems.stop(); - }, + run: () => void reactiveTrayMenuItems.stop(), }; }, diff --git a/src/main/utils/channel/channel-listeners/start-listening-on-channels.injectable.ts b/src/main/utils/channel/channel-listeners/start-listening-on-channels.injectable.ts index d1cf5d68d6..ce6008add4 100644 --- a/src/main/utils/channel/channel-listeners/start-listening-on-channels.injectable.ts +++ b/src/main/utils/channel/channel-listeners/start-listening-on-channels.injectable.ts @@ -16,9 +16,9 @@ const startListeningOnChannelsInjectable = getInjectable({ return { id: "start-listening-on-channels-main", - run: async () => { - await listeningOnMessageChannels.start(); - await listeningOnRequestChannels.start(); + run: () => { + listeningOnMessageChannels.start(); + listeningOnRequestChannels.start(); }, }; },