mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Fix error switching index patterns in Discover
Needed to cleanup debounced function on scope destory. Fixes https://github.com/elastic/kibana/issues/9681
This commit is contained in:
parent
5e0ae4c360
commit
f82624f7cd
1 changed files with 3 additions and 1 deletions
|
@ -117,11 +117,13 @@ uiModules
|
|||
}
|
||||
}
|
||||
|
||||
$scope.$watch(debounce(checkWidth, 100));
|
||||
const debouncedCheckWidth = debounce(checkWidth, 100);
|
||||
$scope.$watch(debouncedCheckWidth);
|
||||
|
||||
// cleanup when the scope is destroyed
|
||||
$scope.$on('$destroy', function () {
|
||||
cleanUp();
|
||||
debouncedCheckWidth.cancel();
|
||||
$scroller = $window = null;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue