Fix TypeError: Cannot read property 'stopServer' of undefined (#1467)

Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>

Co-authored-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
Lauri NevalaandJari Kolehmainen authored and GitHub committed 2020-11-20 13:03:48 +02:00
1 parent c92d1e614a
commit a50fb348b1
1 file changed
+9 -5
+9 -5
View File
@@ -144,18 +144,22 @@ export class Cluster implements ClusterModel {
await this.refreshAllowedResources()
this.isAdmin = await this.isClusterAdmin()
this.ready = true
this.kubeCtl = new Kubectl(this.version)
this.kubeCtl.ensureKubectl() // download kubectl in background, so it's not blocking dashboard
this.ensureKubectl()
}
this.activated = true
return this.pushState();
}
protected async ensureKubectl() {
this.kubeCtl = new Kubectl(this.version)
return this.kubeCtl.ensureKubectl() // download kubectl in background, so it's not blocking dashboard
}
@action
async reconnect() {
logger.info(`[CLUSTER]: reconnect`, this.getMeta());
this.contextHandler.stopServer();
await this.contextHandler.ensureServer();
this.contextHandler?.stopServer();
await this.contextHandler?.ensureServer();
this.disconnected = false;
}
@@ -163,7 +167,7 @@ export class Cluster implements ClusterModel {
disconnect() {
logger.info(`[CLUSTER]: disconnect`, this.getMeta());
this.unbindEvents();
this.contextHandler.stopServer();
this.contextHandler?.stopServer();
this.disconnected = true;
this.online = false;
this.accessible = false;