Commit 21ee85b1 by David Kaltschmidt

Fix issue with deleting a query (empty string not updating)

parent bbaa5b63
...@@ -257,6 +257,14 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> { ...@@ -257,6 +257,14 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
}; };
onChangeQuery = (value: DataQuery, index: number, override?: boolean) => { onChangeQuery = (value: DataQuery, index: number, override?: boolean) => {
// Null value means reset
if (value === null) {
value = { ...generateQueryKeys(index) };
}
// Keep current value in local cache
this.modifiedQueries[index] = value;
if (override) { if (override) {
this.setState(state => { this.setState(state => {
// Replace query row by injecting new key // Replace query row by injecting new key
...@@ -277,9 +285,6 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> { ...@@ -277,9 +285,6 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
queryTransactions: nextQueryTransactions, queryTransactions: nextQueryTransactions,
}; };
}, this.onSubmit); }, this.onSubmit);
} else if (value) {
// Keep current value in local cache
this.modifiedQueries[index] = value;
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment