mirror of
https://github.com/apache/superset.git
synced 2026-05-12 11:25:56 +00:00
fix(explore): Replace url search params only if current page is Explore (#20972)
* fix(explore): Replace url search params only if current page is Explore * Add unit test
This commit is contained in:
committed by
GitHub
parent
499a28f599
commit
9350bbafee
@@ -206,15 +206,18 @@ const updateHistory = debounce(
|
||||
);
|
||||
stateModifier = 'pushState';
|
||||
}
|
||||
const url = mountExploreUrl(
|
||||
standalone ? URL_PARAMS.standalone.name : null,
|
||||
{
|
||||
[URL_PARAMS.formDataKey.name]: key,
|
||||
...additionalParam,
|
||||
},
|
||||
force,
|
||||
);
|
||||
window.history[stateModifier](payload, title, url);
|
||||
// avoid race condition in case user changes route before explore updates the url
|
||||
if (window.location.pathname.startsWith('/explore')) {
|
||||
const url = mountExploreUrl(
|
||||
standalone ? URL_PARAMS.standalone.name : null,
|
||||
{
|
||||
[URL_PARAMS.formDataKey.name]: key,
|
||||
...additionalParam,
|
||||
},
|
||||
force,
|
||||
);
|
||||
window.history[stateModifier](payload, title, url);
|
||||
}
|
||||
} catch (e) {
|
||||
logging.warn('Failed at altering browser history', e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user