From 228bcd8c06e2e47d0c13b5fe043468be0cb10685 Mon Sep 17 00:00:00 2001 From: DiamondThree Date: Thu, 4 Aug 2022 19:05:17 +0800 Subject: [PATCH] fix lint --- .../editor-blocks/src/blocks/text/TextView.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libs/components/editor-blocks/src/blocks/text/TextView.tsx b/libs/components/editor-blocks/src/blocks/text/TextView.tsx index 64f10fc4f..8c4c08557 100644 --- a/libs/components/editor-blocks/src/blocks/text/TextView.tsx +++ b/libs/components/editor-blocks/src/blocks/text/TextView.tsx @@ -99,7 +99,7 @@ export const TextView: FC = ({ if (!parentBlock) { return false; } - let preParent = await parentBlock.previousSibling(); + const preParent = await parentBlock.previousSibling(); if (Protocol.Block.Type.group === parentBlock.type) { const children = await block.children(); const preNode = await block.physicallyPerviousSibling(); @@ -130,8 +130,12 @@ export const TextView: FC = ({ ); if (block.blockProvider.isEmpty()) { await block.remove(); - let parentChild = await parentBlock.children(); - if (!parentChild.length) { + const parentChild = await parentBlock.children(); + if ( + parentBlock.type === + Protocol.Block.Type.group && + !parentChild.length + ) { await editor.selectionManager.setSelectedNodesIds( [preParent.id] );