diff --git a/frontend/src/Editor/Editor.jsx b/frontend/src/Editor/Editor.jsx index cccce7344d..aab8b70931 100644 --- a/frontend/src/Editor/Editor.jsx +++ b/frontend/src/Editor/Editor.jsx @@ -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, diff --git a/frontend/src/_helpers/appUtils.js b/frontend/src/_helpers/appUtils.js index c333ec6340..480f30ecb1 100644 --- a/frontend/src/_helpers/appUtils.js +++ b/frontend/src/_helpers/appUtils.js @@ -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) {