This commit is contained in:
arpitnath 2023-10-17 01:48:19 +05:30
parent b58188b63c
commit fb6bf5a157

View file

@ -29,7 +29,6 @@ import {
removeSelectedComponent,
buildAppDefinition,
buildComponentMetaDefinition,
runQueries,
} from '@/_helpers/appUtils';
import { Confirm } from './Viewer/Confirm';
import { Tooltip as ReactTooltip } from 'react-tooltip';
@ -405,7 +404,6 @@ const EditorComponent = (props) => {
};
const fetchDataQueries = async (id, selectFirstQuery = false, runQueriesOnAppLoad = false) => {
// // editorRef can be undefined when runQueriesOnAppLoad
await useDataQueriesStore
.getState()
.actions.fetchDataQueries(id, selectFirstQuery, runQueriesOnAppLoad, getEditorRef());
@ -1009,8 +1007,22 @@ const EditorComponent = (props) => {
setUndoStack((prev) => prev.slice(0, prev.length - 1));
setRedoStack((prev) => [...prev, diffToPatches(_diffPatches)]);
let undoOpts = optsStack.undo[optsStack.undo.length - 1];
if (undoOpts?.componentDeleted) {
undoOpts = {
componentAdded: true,
};
}
if (undoOpts?.componentAdded) {
undoOpts = {
componentDeleted: true,
};
}
updateState({
appDiffOptions: optsStack.undo[optsStack.undo.length - 1],
appDiffOptions: undoOpts,
});
setOptsStack((prev) => ({