Skip to content

Commit

Permalink
Fixed problem with attributes not updating properly when reloading
Browse files Browse the repository at this point in the history
  • Loading branch information
kishikawakatsumi committed Sep 22, 2024
1 parent e20c9e9 commit a7e2167
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ class DirectoryStructure {
let nodes = await listDirectory(path: path, parent: nil)

tree.nodes = Array(
Set(tree.nodes)
.subtracting(tree.rootNodes())
.union(nodes)
Set(nodes)
.union(
Set(tree.nodes).subtracting(tree.rootNodes())
)
)
viewTree = viewTree(tree)

Expand All @@ -78,9 +79,10 @@ class DirectoryStructure {

let (deleted, inserted) = nodeDelta(oldNodes: children, newNodes: nodes)
tree.nodes = Array(
Set(tree.nodes)
.subtracting(children)
.union(nodes)
Set(nodes)
.union(
Set(tree.nodes).subtracting(tree.rootNodes())
)
)

viewTree = viewTree(tree)
Expand Down

0 comments on commit a7e2167

Please sign in to comment.