use closeNode for eventbus layoutaction

This commit is contained in:
Evan Simkowitz 2024-08-16 11:44:51 -07:00
parent b0a09db4d1
commit a97b8cca58
No known key found for this signature in database

View File

@ -275,11 +275,7 @@ function handleWSEventMessage(msg: WSEventType) {
case LayoutTreeActionType.DeleteNode: {
const leaf = layoutModel?.getNodeByBlockId(layoutAction.blockid);
if (leaf) {
const deleteNodeAction = {
type: LayoutTreeActionType.DeleteNode,
nodeId: leaf.id,
};
layoutModel.treeReducer(deleteNodeAction);
layoutModel.closeNode(leaf);
} else {
console.error(
"Cannot apply eventbus layout action DeleteNode, could not find leaf node with blockId",