mistercrunch closed pull request #5905: [bugfix] ignore history.pushState errors
URL: https://github.com/apache/incubator-superset/pull/5905
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/superset/assets/src/explore/components/ExploreViewContainer.jsx 
b/superset/assets/src/explore/components/ExploreViewContainer.jsx
index 720e72176a..2476615187 100644
--- a/superset/assets/src/explore/components/ExploreViewContainer.jsx
+++ b/superset/assets/src/explore/components/ExploreViewContainer.jsx
@@ -170,10 +170,15 @@ class ExploreViewContainer extends React.Component {
   addHistory({ isReplace = false, title }) {
     const { payload } = getExploreUrlAndPayload({ formData: 
this.props.form_data });
     const longUrl = getExploreLongUrl(this.props.form_data);
-    if (isReplace) {
-      history.replaceState(payload, title, longUrl);
-    } else {
-      history.pushState(payload, title, longUrl);
+    try {
+      if (isReplace) {
+        history.replaceState(payload, title, longUrl);
+      } else {
+        history.pushState(payload, title, longUrl);
+      }
+    } catch (e) {
+      // eslint-disable-next-line no-console
+      console.warn('Failed at altering browser history', payload, title, 
longUrl);
     }
 
     // it seems some browsers don't support pushState title attribute


 

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


With regards,
Apache Git Services

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

Reply via email to