graceguo-supercat commented on a change in pull request #9220: [SQL Lab] 
Implement refetch results button properly
URL: 
https://github.com/apache/incubator-superset/pull/9220#discussion_r386606137
 
 

 ##########
 File path: superset-frontend/src/SqlLab/components/ResultSet.jsx
 ##########
 @@ -258,19 +258,32 @@ export default class ResultSet extends 
React.PureComponent {
       }
     }
     if (query.cached || (query.state === 'success' && !query.results)) {
-      return (
-        <Button
-          bsSize="sm"
-          className="fetch"
-          bsStyle="primary"
-          onClick={this.reFetchQueryResults.bind(this, {
-            ...query,
-            isDataPreview: true,
-          })}
-        >
-          {t('Fetch data preview')}
-        </Button>
-      );
+      if (query.isDataPreview) {
+        return (
+          <Button
+            bsSize="sm"
+            className="fetch"
+            bsStyle="primary"
+            onClick={this.reFetchQueryResults.bind(this, {
 
 Review comment:
   
https://www.freecodecamp.org/news/the-best-way-to-bind-event-handlers-in-react-282db2cf1530/
   
   In Superset code base, usually we bind in constructor.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to