Kill dead code

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen committed 2022-06-03 07:48:04 +03:00
1 parent c1052bf3f5
commit b3cfe7be3f
6 files changed
+3 -295

No files matched your search

-1
View File
@@ -5,5 +5,4 @@
export * from "./ipc";
export * from "./invalid-kubeconfig";
export * from "./update-available";
export * from "./type-enforced-ipc";
-52
View File
@@ -1,52 +0,0 @@
/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import type { UpdateInfo } from "electron-updater";
export const UpdateAvailableChannel = "update-available";
export const AutoUpdateChecking = "auto-update:checking";
export const AutoUpdateNoUpdateAvailable = "auto-update:no-update";
export const AutoUpdateLogPrefix = "[UPDATE-CHECKER]";
export type UpdateAvailableFromMain = [backChannel: string, updateInfo: UpdateInfo];
export function areArgsUpdateAvailableFromMain(args: unknown[]): args is UpdateAvailableFromMain {
if (args.length !== 2) {
return false;
}
if (typeof args[0] !== "string") {
return false;
}
if (typeof args[1] !== "object" || args[1] === null) {
// TODO: improve this checking
return false;
}
return true;
}
export type BackchannelArg = {
doUpdate: false;
} | {
doUpdate: true;
now: boolean;
};
export type UpdateAvailableToBackchannel = [updateDecision: BackchannelArg];
export function areArgsUpdateAvailableToBackchannel(args: unknown[]): args is UpdateAvailableToBackchannel {
if (args.length !== 1) {
return false;
}
if (typeof args[0] !== "object" || args[0] === null) {
// TODO: improve this checking
return false;
}
return true;
}
+1 -5
View File
@@ -4,7 +4,7 @@
*/
import { app } from "electron";
import semver, { SemVer } from "semver";
import semver from "semver";
import { action, computed, observable, reaction, makeObservable, isObservableArray, isObservableSet, isObservableMap } from "mobx";
import { BaseStore } from "../base-store";
import migrations from "../../migrations/user-store";
@@ -100,10 +100,6 @@ export class UserStore extends BaseStore<UserStoreModel> /* implements UserStore
return this.shell || process.env.SHELL || process.env.PTYSHELL;
}
@computed get isAllowedToDowngrade() {
return new SemVer(getAppVersion()).prerelease[0] !== this.updateChannel;
}
startMainReactions() {
// open at system start-up
reaction(() => this.openAtLogin, openAtLogin => {