Skip to content

Commit

Permalink
fix: id should not start with /
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Sep 1, 2024
1 parent f5a19cb commit 6931b9d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/workspace/file-explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ function convert(data: string[]) {
path += "/" + label;
let node = map.get(path);
if (!node) {
map.set(path, (node = { id: path, name: label } as TreeViewElement));
map.set(
path,
(node = { id: path.slice(1), name: label } as TreeViewElement)
);
(parent.children ??= []).push(node);
}
parent = node;
Expand Down

0 comments on commit 6931b9d

Please sign in to comment.