fixes: redo breaks- on deleting a component and undo then redo (editor)

This commit is contained in:
arpitnath 2023-09-25 01:15:47 +05:30
parent 04141a8232
commit f06916940c
2 changed files with 3 additions and 1 deletions

View file

@ -908,7 +908,7 @@ const EditorComponent = (props) => {
const updatedAppDefinition = JSON.parse(JSON.stringify(appDefinition));
handlePaths(patchesToRedo[0]?.value, [...patchesToRedo[0].path], updatedAppDefinition);
removeUndefined(updatedAppDefinition);
const _diffPatches = diff(updatedAppDefinition, appDefinition);
const redoDiff = diff(appDefinition, updatedAppDefinition);
updateAppDefinitionDiff(redoDiff);

View file

@ -1159,6 +1159,8 @@ export function computeComponentState(components = {}) {
const currentComponents = getCurrentState().components;
Object.keys(components).forEach((key) => {
if (!components[key]) return;
const { component } = components[key];
const componentMeta = componentTypes.find((comp) => component.component === comp.component);