Remove ClusterStore.removedClusters and correctly delete lens storage file (#4077)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-10-20 08:51:26 -04:00
1 parent b4a4cc6be4
commit 32562b11a4
5 files changed
+19 -40

No files matched your search

+1 -16
View File
@@ -21,7 +21,7 @@
import "../common/cluster-ipc";
import type http from "http";
import { action, autorun, makeObservable, observable, observe, reaction, toJS } from "mobx";
import { action, makeObservable, observable, observe, reaction, toJS } from "mobx";
import { Cluster } from "./cluster";
import logger from "./logger";
import { apiKubePrefix } from "../common/vars";
@@ -71,21 +71,6 @@ export class ClusterManager extends Singleton {
}
});
// auto-stop removed clusters
autorun(() => {
const removedClusters = Array.from(this.store.removedClusters.values());
if (removedClusters.length > 0) {
const meta = removedClusters.map(cluster => cluster.getMeta());
logger.info(`${logPrefix} removing clusters`, meta);
removedClusters.forEach(cluster => cluster.disconnect());
this.store.removedClusters.clear();
}
}, {
delay: 250
});
ipcMainOn("network:offline", this.onNetworkOffline);
ipcMainOn("network:online", this.onNetworkOnline);
});