mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
fix: show loading-state when activating a cluster or adding new one
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
78a9fcde56
commit
4388558d2e
6 files changed
+43
-8
No files matched your search
@@ -77,6 +77,10 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
||||
@observable removedClusters = observable.map<ClusterId, Cluster>();
|
||||
@observable clusters = observable.map<ClusterId, Cluster>();
|
||||
|
||||
@computed get activeCluster(): Cluster | null {
|
||||
return this.getById(this.activeClusterId);
|
||||
}
|
||||
|
||||
@computed get clustersList(): Cluster[] {
|
||||
return Array.from(this.clusters.values());
|
||||
}
|
||||
@@ -194,7 +198,10 @@ export class ClusterStore extends BaseStore<ClusterStoreModel> {
|
||||
|
||||
export const clusterStore = ClusterStore.getInstance<ClusterStore>();
|
||||
|
||||
export function getHostedClusterId() {
|
||||
return location.hostname.split(".")[0];
|
||||
}
|
||||
|
||||
export function getHostedCluster(): Cluster {
|
||||
const clusterId = location.hostname.split(".")[0];
|
||||
return clusterStore.getById(clusterId);
|
||||
return clusterStore.getById(getHostedClusterId());
|
||||
}
|
||||
Reference in new issue
Block a user