Skip to content

Commit

Permalink
[Maps] fix application state filters transfer from other kibana appli…
Browse files Browse the repository at this point in the history
…cation to maps application (#73516)

* [Maps] fix application state filters transfer from other kibana application to maps application

* clean up comment

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
nreese and elasticmachine committed Jul 30, 2020
1 parent 550d44e commit c09216b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@ export class MapsAppView extends React.Component {
this._globalSyncChangeMonitorSubscription.unsubscribe();
}

// Clean up app state filters
const { filterManager } = getData().query;
filterManager.filters.forEach((filter) => {
if (filter.$state.store === esFilters.FilterStateStore.APP_STATE) {
filterManager.removeFilter(filter);
}
});

getCoreChrome().setBreadcrumbs([]);
}

Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/maps/public/routing/state_syncing/app_sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export function startAppStateSyncing(appStateManager) {
// sync app filters with app state container from data.query to state container
const { query } = getData();

// Filter manager state persists across applications
// clear app state filters to prevent application filters from other applications being transfered to maps
query.filterManager.setAppFilters([]);

const stateContainer = {
get: () => ({
query: appStateManager.getQuery(),
Expand Down

0 comments on commit c09216b

Please sign in to comment.