This commit is contained in:
Rizky 2024-01-25 09:37:40 +07:00
parent cdd87addac
commit 1748c55641
2 changed files with 8 additions and 1 deletions

View File

@ -101,10 +101,16 @@ export const loadCompSnapshot = async (
p.comp.list[comp_id].meta = updated.meta;
p.comp.list[comp_id].tree = updated.tree;
}
p.comp.loaded[comp_id] = doc
.getMap("map")
.get("root")
?.toJSON() as IItem;
if (isTextEditing()) {
return;
}
treeRebuild(p);
p.render();
}
},
};
@ -191,7 +197,7 @@ export const updateComponentMeta = async (
p.comp.loaded[comp_id] = item;
return { meta, tree };
return { meta, tree, item };
};
const transact = {

View File

@ -232,6 +232,7 @@ export const edInitSync = (p: PG) => {
} else if (data.type === "comp") {
const updated = await updateComponentMeta(p, doc, data.id);
if (updated) {
console.log(updated.item);
p.comp.list[data.id].meta = updated.meta;
p.comp.list[data.id].tree = updated.tree;
}