omit extra template refresh (#12454)

This commit is contained in:
Mitsuhiro Tanda 2018-07-02 14:56:24 +09:00 committed by Torkel Ödegaard
parent 861af4cb97
commit aa1b5959da

View File

@ -38,7 +38,11 @@ export class VariableSrv {
});
}
onDashboardRefresh() {
onDashboardRefresh(evt, payload) {
if (payload && payload.fromVariableValueUpdated) {
return Promise.resolve({});
}
var promises = this.variables.filter(variable => variable.refresh === 2).map(variable => {
var previousOptions = variable.options.slice();
@ -130,7 +134,7 @@ export class VariableSrv {
return this.$q.all(promises).then(() => {
if (emitChangeEvents) {
this.$rootScope.$emit('template-variable-value-updated');
this.$rootScope.$broadcast('refresh');
this.$rootScope.$broadcast('refresh', { fromVariableValueUpdated: true });
}
});
}