Klaster1 commented on a change in pull request #5844: Ignite 10538
URL: https://github.com/apache/ignite/pull/5844#discussion_r253397372
 
 

 ##########
 File path: 
modules/web-console/frontend/app/components/ignite-chart/components/chart-no-data/controller.ts
 ##########
 @@ -31,18 +34,33 @@ export default class IgniteChartNoDataCtrl implements 
ng.IOnChanges, ng.IOnDestr
 
     handleClusterInactive: boolean;
 
+    connectionState$ = this.AgentManager.connectionSbj.pipe(
+        pluck('state'),
+        distinctUntilChanged(),
+        tap((state) => {
+            if (state === 'AGENT_DISCONNECTED')
+                this.destroyChart();
+        })
+    );
+
     cluster$ = this.AgentManager.connectionSbj.pipe(
         pluck('cluster'),
+        distinctUntilChanged(),
         tap((cluster) => {
             if (_.isNil(cluster) && !this.AgentManager.isDemoMode()) {
                 this.destroyChart();
                 return;
             }
 
-            if (cluster.active === false && this.handleClusterInactive)
+            if (!_.isNil(cluster) && cluster.active === false && 
this.handleClusterInactive)
 
 Review comment:
   Why import lodash if you can simply `!!cluster && cluster.active === false` 
or even `cluster && cluster.active === false`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to