feat: merge middle part

This commit is contained in:
wancat authored and Chen, Tai-Lin committed 2023-08-28 14:39:52 +08:00
1 parent a66de4dfe1
commit 1b51346eb9
2 files changed
+62 -19

No files matched your search

+5 -3
View File
@@ -63,9 +63,11 @@ export default class FileNode extends File {
})
// If a child exists in this node but not in the provided node, remove it
this.children = this.children.filter((child) =>
fileNode.children.some((c) => c.path === child.path)
)
if (fileNode.children.length > 0) {
this.children = this.children.filter((child) =>
fileNode.children.some((c) => c.path === child.path)
)
}
} else if (this.contains(fileNode)) {
const childNode = this.children.find((child) => child.contains(fileNode))
if (childNode) {