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:
David Kaltschmidt
2018-11-01 09:36:09 +01:00
parent 74c9defede
commit edd575b552
5 changed files with 16 additions and 19 deletions

View File

@@ -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;