mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 10:23:14 -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);
|
}, 100);
|
||||||
|
|
||||||
$scope.vis.on('update', () => {
|
//todo: clean this one up as well
|
||||||
|
const handleVisUpdate = () => {
|
||||||
if ($scope.editorMode) {
|
if ($scope.editorMode) {
|
||||||
$scope.appState.vis = $scope.vis.getState();
|
$scope.appState.vis = $scope.vis.getState();
|
||||||
$scope.appState.save();
|
$scope.appState.save();
|
||||||
} else {
|
} else {
|
||||||
$scope.fetch();
|
$scope.fetch();
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
$scope.vis.on('update', handleVisUpdate);
|
||||||
|
|
||||||
|
|
||||||
const reload = () => {
|
const reload = () => {
|
||||||
$scope.vis.reload = true;
|
$scope.vis.reload = true;
|
||||||
|
@ -139,7 +142,13 @@ uiModules
|
||||||
$scope.$on('courier:searchRefresh', reload);
|
$scope.$on('courier:searchRefresh', reload);
|
||||||
// dashboard will fire fetch event when it wants to refresh
|
// dashboard will fire fetch event when it wants to refresh
|
||||||
$scope.$on('fetch', reload);
|
$scope.$on('fetch', reload);
|
||||||
queryFilter.on('update', $scope.fetch);
|
|
||||||
|
|
||||||
|
|
||||||
|
const handleQueryUpdate = ()=> {
|
||||||
|
$scope.fetch();
|
||||||
|
};
|
||||||
|
queryFilter.on('update', handleQueryUpdate);
|
||||||
|
|
||||||
if ($scope.appState) {
|
if ($scope.appState) {
|
||||||
let oldUiState;
|
let oldUiState;
|
||||||
|
@ -187,6 +196,8 @@ uiModules
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$on('$destroy', () => {
|
$scope.$on('$destroy', () => {
|
||||||
|
$scope.vis.removeListener('update', handleVisUpdate);
|
||||||
|
queryFilter.off('update', handleQueryUpdate);
|
||||||
resizeChecker.destroy();
|
resizeChecker.destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue