fix(editor): 修改根节点不添加历史记录

This commit is contained in:
roymondchen 2023-11-22 15:46:00 +08:00
parent 19d24f4089
commit c9aab11e03

View File

@ -548,7 +548,9 @@ class Editor extends BaseService {
const newNodes = await Promise.all(nodes.map((node) => this.doUpdate(node)));
this.pushHistoryState();
if (newNodes[0]?.type !== NodeType.ROOT) {
this.pushHistoryState();
}
this.emit('update', newNodes);
return Array.isArray(config) ? newNodes : newNodes[0];