Skip to content

Commit

Permalink
Execute query as soon as saved query is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Maja Grubic committed Jan 30, 2020
1 parent 7b6787f commit 09a463f
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,7 @@ export class DashboardAppController {

$scope.onSavedQueryUpdated = savedQuery => {
$scope.savedQuery = { ...savedQuery };
updateState();
updateNavBar();
updateStateFromSavedQuery(savedQuery);
};

$scope.onClearSavedQuery = () => {
Expand Down Expand Up @@ -574,16 +573,13 @@ export class DashboardAppController {
}
// Making this method sync broke the updates.
// Temporary fix, until we fix the complex state in this file.
setTimeout(() => {
queryFilter.setFilters(allFilters);
}, 0);
queryFilter.setFilters(allFilters);
updateNavBar();
};

$scope.$watch('savedQuery', (newSavedQuery: SavedQuery) => {
if (!newSavedQuery) return;
dashboardStateManager.setSavedQueryId(newSavedQuery.id);

updateStateFromSavedQuery(newSavedQuery);
});

Expand Down

0 comments on commit 09a463f

Please sign in to comment.