1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Kill dead code

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-05-11 10:35:20 +03:00
parent 9a0da94de8
commit cd4fda5495
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A
7 changed files with 1 additions and 133 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 syncThemeFromOperatingSystemInjectable from "./electron-app/features/sync-theme-from-operating-system.injectable";
import platformInjectable from "../common/vars/platform.injectable"; import platformInjectable from "../common/vars/platform.injectable";
import productNameInjectable from "./app-paths/app-name/product-name.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 quitAndInstallUpdateInjectable from "./electron-app/features/quit-and-install-update.injectable";
import electronUpdaterIsActiveInjectable from "./electron-app/features/electron-updater-is-active.injectable"; import electronUpdaterIsActiveInjectable from "./electron-app/features/electron-updater-is-active.injectable";
import publishIsConfiguredInjectable from "./update-app/publish-is-configured.injectable"; import publishIsConfiguredInjectable from "./update-app/publish-is-configured.injectable";
@ -222,7 +221,6 @@ const overrideElectronFeatures = (di: DiContainer) => {
di.override(ipcMainInjectable, () => ({})); di.override(ipcMainInjectable, () => ({}));
di.override(getElectronThemeInjectable, () => () => "dark"); di.override(getElectronThemeInjectable, () => () => "dark");
di.override(syncThemeFromOperatingSystemInjectable, () => ({ start: () => {}, stop: () => {} })); di.override(syncThemeFromOperatingSystemInjectable, () => ({ start: () => {}, stop: () => {} }));
di.override(syncUpdateIsReadyToBeInstalledInjectable, () => ({ start: () => {}, stop: () => {} }));
di.override(quitAndInstallUpdateInjectable, () => () => {}); di.override(quitAndInstallUpdateInjectable, () => () => {});
di.override(checkForPlatformUpdatesInjectable, () => () => { di.override(checkForPlatformUpdatesInjectable, () => () => {

View File

@ -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<boolean>(false),
});
export default updateIsReadyToBeInstalledStateInjectable;

View File

@ -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;

View File

@ -7,7 +7,7 @@ import rendererExtensionsInjectable from "../../../extensions/renderer-extension
import currentlyInClusterFrameInjectable from "../../routes/currently-in-cluster-frame.injectable"; import currentlyInClusterFrameInjectable from "../../routes/currently-in-cluster-frame.injectable";
import { extensionRegistratorInjectionToken } from "../../../extensions/extension-loader/extension-registrator-injection-token"; import { extensionRegistratorInjectionToken } from "../../../extensions/extension-loader/extension-registrator-injection-token";
import type { IObservableArray } from "mobx"; import type { IObservableArray } from "mobx";
import { action, computed, observable, runInAction } from "mobx"; import { computed, observable, runInAction } from "mobx";
import { renderFor } from "./renderFor"; import { renderFor } from "./renderFor";
import React from "react"; import React from "react";
import { Router } from "react-router"; import { Router } from "react-router";
@ -46,7 +46,6 @@ import namespaceStoreInjectable from "../+namespaces/store.injectable";
import historyInjectable from "../../navigation/history.injectable"; import historyInjectable from "../../navigation/history.injectable";
import trayMenuItemsInjectable from "../../../main/tray/tray-menu-item/tray-menu-items.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 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"; import electronTrayInjectable from "../../../main/tray/electron-tray/electron-tray.injectable";
type Callback = (dis: DiContainers) => void | Promise<void>; type Callback = (dis: DiContainers) => void | Promise<void>;
@ -60,10 +59,6 @@ export interface ApplicationBuilder {
beforeRender: (callback: Callback) => ApplicationBuilder; beforeRender: (callback: Callback) => ApplicationBuilder;
render: () => Promise<RenderResult>; render: () => Promise<RenderResult>;
applicationUpdater: {
setUpdateIsReadyToBeInstalled: (available: boolean) => void;
};
tray: { tray: {
click: (id: string) => Promise<void>; click: (id: string) => Promise<void>;
get: (id: string) => TrayMenuItem | undefined; get: (id: string) => TrayMenuItem | undefined;
@ -168,14 +163,6 @@ export const getApplicationBuilder = () => {
const builder: ApplicationBuilder = { const builder: ApplicationBuilder = {
dis, dis,
applicationUpdater: {
setUpdateIsReadyToBeInstalled: action((available: boolean) => {
const updateIsAvailableState = mainDi.inject(updateIsAvailableStateInjectable);
updateIsAvailableState.set(available);
}),
},
applicationMenu: { applicationMenu: {
click: async (path: string) => { click: async (path: string) => {
const applicationMenuItems = mainDi.inject( const applicationMenuItems = mainDi.inject(