Don't abort when executing empty expression

Signed-off-by: Julius Volz <julius.volz@gmail.com>
This commit is contained in:
Julius Volz 2019-02-12 23:30:54 +01:00
parent 9f5bc08f02
commit 08e474dd48

View file

@ -210,6 +210,10 @@ class Panel extends Component {
}
executeQuery = ()=> {
if (this.state.expr === '') {
return;
}
if (this.abortInFlightFetch) {
this.abortInFlightFetch();
this.abortInFlightFetch = null;
@ -219,10 +223,6 @@ class Panel extends Component {
this.abortInFlightFetch = () => abortController.abort();
this.setState({loading: true});
if (this.state.expr === '') {
return;
}
let endTime = this.getEndTime() / 1000;
let startTime = endTime - this.state.range;
let resolution = this.state.resolution || Math.max(Math.floor(this.state.range / 250), 1);