Fixed bug on running query after renaming it (#6462)

* Fixed issue on running query after renaming it

* Fixed issue on renaming query after updating version
This commit is contained in:
Kavin Venkatachalam 2023-05-18 17:26:30 +05:30 committed by GitHub
parent af89e370cd
commit 514afa595f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -400,6 +400,8 @@ class EditorComponent extends React.Component {
if (version?.id === this.state.app?.current_version_id) {
(this.canUndo = false), (this.canRedo = false);
}
useAppDataStore.getState().actions.updateEditingVersion(version);
this.setState(
{
editingVersion: version,

View file

@ -887,7 +887,7 @@ export function previewQuery(_ref, query, editorState, calledFromQuery = false)
}
export function runQuery(_ref, queryId, queryName, confirmed = undefined, mode = 'edit') {
const query = useDataQueriesStore.getState().dataQueries.find((query) => query.name === queryName);
const query = useDataQueriesStore.getState().dataQueries.find((query) => query.id === queryId);
let dataQuery = {};
if (query) {