Optimise cluster activate and refresh (#938)

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala authored and GitHub committed 2020-09-21 13:20:50 +03:00
1 parent bddc6b33e3
commit 299eceaee4
5 files changed
+42 -11

No files matched your search

@@ -39,7 +39,7 @@ export class ClusterStatus extends React.Component<Props> {
});
})
if (this.cluster.disconnected) {
await this.refreshCluster();
await this.activateCluster();
}
}
@@ -47,13 +47,13 @@ export class ClusterStatus extends React.Component<Props> {
ipcRenderer.removeAllListeners(`kube-auth:${this.props.clusterId}`);
}
refreshCluster = async () => {
activateCluster = async () => {
await clusterIpc.activate.invokeFromRenderer(this.props.clusterId);
}
reconnect = async () => {
this.isReconnecting = true;
await this.refreshCluster();
await this.activateCluster();
this.isReconnecting = false;
}