mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Stop listening to filter updates when exiting Visualize (#14647)
This commit is contained in:
parent
32a74e1ad1
commit
a348ea74e5
1 changed files with 14 additions and 3 deletions
|
@ -121,14 +121,17 @@ uiModules
|
|||
});
|
||||
}, 100);
|
||||
|
||||
$scope.vis.on('update', () => {
|
||||
//todo: clean this one up as well
|
||||
const handleVisUpdate = () => {
|
||||
if ($scope.editorMode) {
|
||||
$scope.appState.vis = $scope.vis.getState();
|
||||
$scope.appState.save();
|
||||
} else {
|
||||
$scope.fetch();
|
||||
}
|
||||
});
|
||||
};
|
||||
$scope.vis.on('update', handleVisUpdate);
|
||||
|
||||
|
||||
const reload = () => {
|
||||
$scope.vis.reload = true;
|
||||
|
@ -139,7 +142,13 @@ uiModules
|
|||
$scope.$on('courier:searchRefresh', reload);
|
||||
// dashboard will fire fetch event when it wants to refresh
|
||||
$scope.$on('fetch', reload);
|
||||
queryFilter.on('update', $scope.fetch);
|
||||
|
||||
|
||||
|
||||
const handleQueryUpdate = ()=> {
|
||||
$scope.fetch();
|
||||
};
|
||||
queryFilter.on('update', handleQueryUpdate);
|
||||
|
||||
if ($scope.appState) {
|
||||
let oldUiState;
|
||||
|
@ -187,6 +196,8 @@ uiModules
|
|||
});
|
||||
|
||||
$scope.$on('$destroy', () => {
|
||||
$scope.vis.removeListener('update', handleVisUpdate);
|
||||
queryFilter.off('update', handleQueryUpdate);
|
||||
resizeChecker.destroy();
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue