mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
* Fixed race condition causing issues with TSVB drilldowns Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
570556b65a
commit
59b34d346c
1 changed files with 15 additions and 9 deletions
|
@ -25,6 +25,8 @@ import { convertSavedPanelsToPanelMap } from './convert_dashboard_panels';
|
|||
|
||||
type SyncDashboardUrlStateProps = DashboardBuildContext & { savedDashboard: DashboardSavedObject };
|
||||
|
||||
let awaitingRemoval = false;
|
||||
|
||||
export const syncDashboardUrlState = ({
|
||||
dispatchDashboardStateChange,
|
||||
getLatestDashboardState,
|
||||
|
@ -89,15 +91,19 @@ const loadDashboardUrlState = ({
|
|||
: undefined;
|
||||
|
||||
// remove state from URL
|
||||
kbnUrlStateStorage.kbnUrlControls.updateAsync((nextUrl) => {
|
||||
if (nextUrl.includes(DASHBOARD_STATE_STORAGE_KEY)) {
|
||||
return replaceUrlHashQuery(nextUrl, (query) => {
|
||||
delete query[DASHBOARD_STATE_STORAGE_KEY];
|
||||
return query;
|
||||
});
|
||||
}
|
||||
return nextUrl;
|
||||
}, true);
|
||||
if (!awaitingRemoval) {
|
||||
awaitingRemoval = true;
|
||||
kbnUrlStateStorage.kbnUrlControls.updateAsync((nextUrl) => {
|
||||
if (nextUrl.includes(DASHBOARD_STATE_STORAGE_KEY)) {
|
||||
return replaceUrlHashQuery(nextUrl, (query) => {
|
||||
delete query[DASHBOARD_STATE_STORAGE_KEY];
|
||||
return query;
|
||||
});
|
||||
}
|
||||
awaitingRemoval = false;
|
||||
return nextUrl;
|
||||
}, true);
|
||||
}
|
||||
|
||||
return {
|
||||
..._.omit(rawAppStateInUrl, ['panels', 'query']),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue