Fix double fetch errors (#54701)
This commit is contained in:
parent
3419b06ee3
commit
c8c03e4e85
|
@ -826,9 +826,14 @@ function discoverController(
|
|||
};
|
||||
|
||||
$scope.updateQueryAndFetch = function({ query, dateRange }) {
|
||||
const oldDateRange = timefilter.getTime();
|
||||
timefilter.setTime(dateRange);
|
||||
$state.query = query;
|
||||
$scope.fetch();
|
||||
// storing the updated timerange in the state will trigger a fetch
|
||||
// call automatically, so only trigger fetch in case this is a refresh call (no changes in parameters).
|
||||
if (_.isEqual(oldDateRange, dateRange)) {
|
||||
$scope.fetch();
|
||||
}
|
||||
};
|
||||
|
||||
function onResults(resp) {
|
||||
|
|
Loading…
Reference in a new issue