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

@ -95,9 +95,9 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
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());
}
}
@ -119,7 +119,7 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
this.languageProvider
.fetchLabelValues(targetOption.value)
.then(this.onReceiveMetrics)
.then(this.onUpdateLanguage)
.catch(() => {});
};
@ -147,7 +147,7 @@ class LoggingQueryField extends React.PureComponent<LoggingQueryFieldProps, Logg
}
};
onReceiveMetrics = () => {
onUpdateLanguage = () => {
Prism.languages[PRISM_SYNTAX] = this.languageProvider.getSyntax();
const { logLabelOptions } = this.languageProvider;
this.setState({