Skip to content

Commit

Permalink
updating based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Oct 29, 2019
1 parent 4f3a126 commit 78e3db4
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/legacy/core_plugins/kibana/public/visualize/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,14 @@ function VisEditor(
$appStatus.dirty = status.dirty || !savedVis.id;
});

$scope.$watch('state.query', (newQuery) => {
const query = migrateLegacyQuery(newQuery);
$scope.updateQueryAndFetch({ query });
$scope.$watch('state.query', (newQuery, oldQuery) => {
if (!_.isEqual(newQuery, oldQuery)) {
const query = migrateLegacyQuery(newQuery);
if (!_.isEqual(query, newQuery)) {
$state.query = query;
}
$scope.fetch();
}
});

$state.replace();
Expand Down Expand Up @@ -470,7 +475,9 @@ function VisEditor(
timefilter.setTime(dateRange);

// If nothing has changed, trigger the fetch manually, otherwise it will happen as a result of the changes
if (!isUpdate) $scope.fetch();
if (!isUpdate) {
$scope.vis.forceReload();
}
};

$scope.onRefreshChange = function ({ isPaused, refreshInterval }) {
Expand Down

0 comments on commit 78e3db4

Please sign in to comment.