You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/03/28 01:39:19 UTC

[GitHub] [incubator-superset] ktmud commented on a change in pull request #9400: Build: fix hot reload for charts

ktmud commented on a change in pull request #9400: Build: fix hot reload for charts
URL: https://github.com/apache/incubator-superset/pull/9400#discussion_r399603070
 
 

 ##########
 File path: superset-frontend/src/chart/ChartRenderer.jsx
 ##########
 @@ -78,28 +114,37 @@ class ChartRenderer extends React.Component {
   }
 
   shouldComponentUpdate(nextProps) {
-    const resultsReady =
-      nextProps.queryResponse &&
-      ['success', 'rendered'].indexOf(nextProps.chartStatus) > -1 &&
-      !nextProps.queryResponse.error &&
-      !nextProps.refreshOverlayVisible;
-
-    if (resultsReady) {
-      this.hasQueryResponseChange =
-        nextProps.queryResponse !== this.props.queryResponse;
-
-      if (
-        this.hasQueryResponseChange ||
-        nextProps.annotationData !== this.props.annotationData ||
-        nextProps.height !== this.props.height ||
-        nextProps.width !== this.props.width ||
-        nextProps.triggerRender ||
-        nextProps.formData.color_scheme !== this.props.formData.color_scheme
-      ) {
-        return true;
-      }
+    // if no results loaded, don't render
+    if (
+      !nextProps.queryResponse ||
+      nextProps.queryResponse.error ||
+      nextProps.refreshOverlayVisible
+    ) {
+      return false;
+    }
+
+    this.hasQueryResponseChange =
+      this.props.queryResponse !== nextProps.queryResponse;
 
 Review comment:
   I've changed the default return at the end to `true` instead of `false`, so this is not needed any more.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org