diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index b55eaf0fba..84c9636589 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -978,6 +978,7 @@ class EditorComponent extends React.Component { return this.setState({ draftQuery: { ...this.state.draftQuery, name: newName }, renameQueryName: false, + selectedQuery: { ...this.state.selectedQuery, name: newName }, }); } dataqueryService diff --git a/frontend/src/Editor/QueryManager/QueryManager.jsx b/frontend/src/Editor/QueryManager/QueryManager.jsx index 442845d23e..7e35e28e91 100644 --- a/frontend/src/Editor/QueryManager/QueryManager.jsx +++ b/frontend/src/Editor/QueryManager/QueryManager.jsx @@ -167,6 +167,14 @@ class QueryManagerComponent extends React.Component { ); }; + componentDidUpdate(prevState) { + if (prevState?.selectedQuery?.name !== this.state?.selectedQuery?.name) { + this.setState({ + queryName: this.state.selectedQuery?.name, + }); + } + } + componentWillReceiveProps(nextProps) { if (nextProps.loadingDataSources) return; if (this.props.showQueryConfirmation && !nextProps.showQueryConfirmation) {