Skip to content

Commit

Permalink
remove unnecessary node transform
Browse files Browse the repository at this point in the history
  • Loading branch information
amanharwara committed May 5, 2024
1 parent 69b21d9 commit 710e21c
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,6 @@ export default function FilePlugin({ currentNote }: { currentNote: SNNote }): JS
},
COMMAND_PRIORITY_NORMAL,
),
editor.registerNodeTransform(FileNode, (node) => {
/**
* When adding the node we wrap it with a paragraph to avoid insertion errors,
* however that causes issues with selection. We unwrap the node to fix that.
*/
const parent = node.getParent()
if (!parent) {
return
}
if (parent.getChildrenSize() === 1) {
parent.insertBefore(node)
parent.remove()
}
}),
)
}, [application, currentNote, editor, filesController, linkingController])

Expand Down

0 comments on commit 710e21c

Please sign in to comment.