Skip to content

Commit

Permalink
fix(editor): 修复 update 返回值三目运算符判断错误的问题,同时优化输入与输入类型一致。
Browse files Browse the repository at this point in the history
  • Loading branch information
WangMingHua111 authored and jia000 committed Aug 23, 2022
1 parent 547e733 commit 9b0db4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/editor/src/services/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ class Editor extends BaseService {

this.emit('add', newNodes);

return newNodes.length > 1 ? newNodes : newNodes[0];
return Array.isArray(addNode) ? newNodes : newNodes[0];
}

public async doRemove(node: MNode): Promise<void> {
Expand Down Expand Up @@ -504,7 +504,7 @@ class Editor extends BaseService {

this.emit('update', newNodes);

return newNodes.length > 1 ? newNodes[0] : newNodes;
return Array.isArray(config) ? newNodes : newNodes[0];
}

/**
Expand Down

0 comments on commit 9b0db4a

Please sign in to comment.