Skip to content

Commit

Permalink
fix query manage old state retained on add query (ToolJet#1537)
Browse files Browse the repository at this point in the history
  • Loading branch information
gondar00 authored Dec 8, 2021
1 parent bc19612 commit 886da25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/src/Editor/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,8 @@ class Editor extends React.Component {
className="btn btn-sm btn-light btn-px-1 text-muted"
onClick={() =>
this.setState({
options: {},
selectedDataSource: null,
selectedQuery: {},
editingQuery: false,
addingQuery: true,
Expand Down Expand Up @@ -915,6 +917,7 @@ class Editor extends React.Component {
dataQueries={dataQueries}
mode={editingQuery ? 'edit' : 'create'}
selectedQuery={selectedQuery}
selectedDataSource={this.state.selectedDataSource}
dataQueriesChanged={this.dataQueriesChanged}
appId={appId}
addingQuery={addingQuery}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/Editor/QueryManager/QueryManager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ let QueryManager = class QueryManager extends React.Component {
queryPaneHeight: props.queryPaneHeight,
currentState: props.currentState,
selectedSource: source,
selectedDataSource: props.selectedDataSource,
},
() => {
if (this.props.mode === 'edit') {
Expand Down

0 comments on commit 886da25

Please sign in to comment.