mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: fix metric selector for additional rows
- race condition in language provider leads to only one row getting selector options - fixed by always returning the start task promise
This commit is contained in:
@@ -134,9 +134,9 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
|
||||
this.languageProvider
|
||||
.start()
|
||||
.then(remaining => {
|
||||
remaining.map(task => task.then(this.onReceiveMetrics).catch(() => {}));
|
||||
remaining.map(task => task.then(this.onUpdateLanguage).catch(() => {}));
|
||||
})
|
||||
.then(() => this.onReceiveMetrics());
|
||||
.then(() => this.onUpdateLanguage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
|
||||
}
|
||||
};
|
||||
|
||||
onReceiveMetrics = () => {
|
||||
onUpdateLanguage = () => {
|
||||
const { histogramMetrics, metrics } = this.languageProvider;
|
||||
if (!metrics) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user