Skip to content

Commit

Permalink
fix: Duplicated folder in TreeView sometime crashes render (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
turtton authored Mar 3, 2024
1 parent 4498f5c commit 9e2a21e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { DirectoryTree } from "directory-tree";
import { getMarkdownFolder } from "./io";
import { getRouterPath } from "./slug";

export interface TreeData {
Expand All @@ -16,7 +17,7 @@ export function convertTreeData(thisObject: DirectoryTree): TreeData {
const newObject: TreeData = {
name: objectName.replace(".md", ""),
children,
id: routerPath ?? objectName,
id: thisObject.path.replace(getMarkdownFolder(), ""),
routePath: routerPath,
};

Expand Down

0 comments on commit 9e2a21e

Please sign in to comment.