diff --git a/src/main/electron-app/runnables/update-application/start-syncing-update-is-ready-to-be-installed.injectable.ts b/src/main/electron-app/runnables/update-application/start-syncing-update-is-ready-to-be-installed.injectable.ts deleted file mode 100644 index cdca7e2f8f..0000000000 --- a/src/main/electron-app/runnables/update-application/start-syncing-update-is-ready-to-be-installed.injectable.ts +++ /dev/null @@ -1,25 +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 syncUpdateIsReadyToBeInstalledInjectable from "./sync-update-is-ready-to-be-installed.injectable"; -import { onLoadOfApplicationInjectionToken } from "../../../start-main-application/runnable-tokens/on-load-of-application-injection-token"; - -const startSyncingUpdateIsReadyToBeInstalledInjectable = getInjectable({ - id: "start-syncing-update-is-ready-to-be-installed", - - instantiate: (di) => { - const syncUpdateIsReadyToBeInstalledState = di.inject(syncUpdateIsReadyToBeInstalledInjectable); - - return { - run: () => { - syncUpdateIsReadyToBeInstalledState.start(); - }, - }; - }, - - injectionToken: onLoadOfApplicationInjectionToken, -}); - -export default startSyncingUpdateIsReadyToBeInstalledInjectable; diff --git a/src/main/electron-app/runnables/update-application/stop-syncing-update-is-ready-to-be-installed.injectable.ts b/src/main/electron-app/runnables/update-application/stop-syncing-update-is-ready-to-be-installed.injectable.ts deleted file mode 100644 index 58084d86ef..0000000000 --- a/src/main/electron-app/runnables/update-application/stop-syncing-update-is-ready-to-be-installed.injectable.ts +++ /dev/null @@ -1,25 +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 syncUpdateIsReadyToBeInstalledInjectable from "./sync-update-is-ready-to-be-installed.injectable"; -import { beforeQuitOfBackEndInjectionToken } from "../../../start-main-application/runnable-tokens/before-quit-of-back-end-injection-token"; - -const stopSyncingUpdateIsReadyToBeInstalledInjectable = getInjectable({ - id: "stop-syncing-update-is-ready-to-be-installed", - - instantiate: (di) => { - const syncUpdateIsReadyToBeInstalled = di.inject(syncUpdateIsReadyToBeInstalledInjectable); - - return { - run: () => { - syncUpdateIsReadyToBeInstalled.stop(); - }, - }; - }, - - injectionToken: beforeQuitOfBackEndInjectionToken, -}); - -export default stopSyncingUpdateIsReadyToBeInstalledInjectable; diff --git a/src/main/electron-app/runnables/update-application/sync-update-is-ready-to-be-installed.injectable.ts b/src/main/electron-app/runnables/update-application/sync-update-is-ready-to-be-installed.injectable.ts deleted file mode 100644 index e635386621..0000000000 --- a/src/main/electron-app/runnables/update-application/sync-update-is-ready-to-be-installed.injectable.ts +++ /dev/null @@ -1,35 +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 { getStartableStoppable } from "../../../../common/utils/get-startable-stoppable"; -import electronUpdaterInjectable from "../../features/electron-updater.injectable"; -import updateIsReadyToBeInstalledStateInjectable from "../../../update-app/update-is-ready-to-be-installed-state.injectable"; - -const syncUpdateIsReadyToBeInstalledInjectable = getInjectable({ - id: "sync-update-is-ready-to-be-installed", - - instantiate: (di) => { - const electronUpdater = di.inject(electronUpdaterInjectable); - const updateIsReadyToBeInstalledState = di.inject(updateIsReadyToBeInstalledStateInjectable); - - - return getStartableStoppable( - "synchronize-update-is-available-state", - () => { - const makeUpdateReadyToBeInstalled = () => { - updateIsReadyToBeInstalledState.set(true); - }; - - electronUpdater.on("update-downloaded", makeUpdateReadyToBeInstalled); - - return () => { - electronUpdater.off("update-downloaded", makeUpdateReadyToBeInstalled); - }; - }, - ); - }, -}); - -export default syncUpdateIsReadyToBeInstalledInjectable; diff --git a/src/main/getDiForUnitTesting.ts b/src/main/getDiForUnitTesting.ts index a8c5932b69..ef0ce97274 100644 --- a/src/main/getDiForUnitTesting.ts +++ b/src/main/getDiForUnitTesting.ts @@ -76,7 +76,6 @@ import getElectronThemeInjectable from "./electron-app/features/get-electron-the import syncThemeFromOperatingSystemInjectable from "./electron-app/features/sync-theme-from-operating-system.injectable"; import platformInjectable from "../common/vars/platform.injectable"; import productNameInjectable from "./app-paths/app-name/product-name.injectable"; -import syncUpdateIsReadyToBeInstalledInjectable from "./electron-app/runnables/update-application/sync-update-is-ready-to-be-installed.injectable"; import quitAndInstallUpdateInjectable from "./electron-app/features/quit-and-install-update.injectable"; import electronUpdaterIsActiveInjectable from "./electron-app/features/electron-updater-is-active.injectable"; import publishIsConfiguredInjectable from "./update-app/publish-is-configured.injectable"; @@ -222,7 +221,6 @@ const overrideElectronFeatures = (di: DiContainer) => { di.override(ipcMainInjectable, () => ({})); di.override(getElectronThemeInjectable, () => () => "dark"); di.override(syncThemeFromOperatingSystemInjectable, () => ({ start: () => {}, stop: () => {} })); - di.override(syncUpdateIsReadyToBeInstalledInjectable, () => ({ start: () => {}, stop: () => {} })); di.override(quitAndInstallUpdateInjectable, () => () => {}); di.override(checkForPlatformUpdatesInjectable, () => () => { diff --git a/src/main/update-app/update-is-ready-to-be-installed-state.injectable.ts b/src/main/update-app/update-is-ready-to-be-installed-state.injectable.ts deleted file mode 100644 index bdabefe29a..0000000000 --- a/src/main/update-app/update-is-ready-to-be-installed-state.injectable.ts +++ /dev/null @@ -1,13 +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 { observable } from "mobx"; - -const updateIsReadyToBeInstalledStateInjectable = getInjectable({ - id: "update-is-ready-to-be-installed-state", - instantiate: () => observable.box(false), -}); - -export default updateIsReadyToBeInstalledStateInjectable; diff --git a/src/main/update-app/update-is-ready-to-be-installed.injectable.ts b/src/main/update-app/update-is-ready-to-be-installed.injectable.ts deleted file mode 100644 index ad84c23642..0000000000 --- a/src/main/update-app/update-is-ready-to-be-installed.injectable.ts +++ /dev/null @@ -1,19 +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 { computed } from "mobx"; -import updateIsReadyToBeInstalledInjectableState from "./update-is-ready-to-be-installed-state.injectable"; - -const updateIsReadyToBeInstalledInjectable = getInjectable({ - id: "update-is-ready-to-be-installed", - - instantiate: (di) => { - const updateIsReadyToBeInstalledState = di.inject(updateIsReadyToBeInstalledInjectableState); - - return computed(() => updateIsReadyToBeInstalledState.get()); - }, -}); - -export default updateIsReadyToBeInstalledInjectable; diff --git a/src/renderer/components/test-utils/get-application-builder.tsx b/src/renderer/components/test-utils/get-application-builder.tsx index c2fe44d452..d373611d30 100644 --- a/src/renderer/components/test-utils/get-application-builder.tsx +++ b/src/renderer/components/test-utils/get-application-builder.tsx @@ -7,7 +7,7 @@ import rendererExtensionsInjectable from "../../../extensions/renderer-extension import currentlyInClusterFrameInjectable from "../../routes/currently-in-cluster-frame.injectable"; import { extensionRegistratorInjectionToken } from "../../../extensions/extension-loader/extension-registrator-injection-token"; import type { IObservableArray } from "mobx"; -import { action, computed, observable, runInAction } from "mobx"; +import { computed, observable, runInAction } from "mobx"; import { renderFor } from "./renderFor"; import React from "react"; import { Router } from "react-router"; @@ -46,7 +46,6 @@ import namespaceStoreInjectable from "../+namespaces/store.injectable"; import historyInjectable from "../../navigation/history.injectable"; import trayMenuItemsInjectable from "../../../main/tray/tray-menu-item/tray-menu-items.injectable"; import type { TrayMenuItem } from "../../../main/tray/tray-menu-item/tray-menu-item-injection-token"; -import updateIsAvailableStateInjectable from "../../../main/update-app/update-is-ready-to-be-installed-state.injectable"; import electronTrayInjectable from "../../../main/tray/electron-tray/electron-tray.injectable"; type Callback = (dis: DiContainers) => void | Promise; @@ -60,10 +59,6 @@ export interface ApplicationBuilder { beforeRender: (callback: Callback) => ApplicationBuilder; render: () => Promise; - applicationUpdater: { - setUpdateIsReadyToBeInstalled: (available: boolean) => void; - }; - tray: { click: (id: string) => Promise; get: (id: string) => TrayMenuItem | undefined; @@ -168,14 +163,6 @@ export const getApplicationBuilder = () => { const builder: ApplicationBuilder = { dis, - applicationUpdater: { - setUpdateIsReadyToBeInstalled: action((available: boolean) => { - const updateIsAvailableState = mainDi.inject(updateIsAvailableStateInjectable); - - updateIsAvailableState.set(available); - }), - }, - applicationMenu: { click: async (path: string) => { const applicationMenuItems = mainDi.inject(