Skip to content

Commit 0652151

Browse files
committed
fix
1 parent 307cf72 commit 0652151

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/client/utils/sanitize.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,13 @@ interface RawNodeDatum {
5252
children?: RawNodeDatum[]
5353
errorBoundary: { hasErrorBoundary: boolean; errorBoundaryId: string | null }
5454
}
55-
const routeMap = new Map()
55+
5656
const constructTree = (routes: any, parentId?: string): RawNodeDatum[] => {
5757
const nodes: RawNodeDatum[] = []
5858
const routeKeys = Object.keys(routes)
5959
for (const key of routeKeys) {
6060
const route = routes[key]
6161
if (route.parentId === parentId) {
62-
if (routeMap.get(key)) {
63-
nodes.push(routeMap.get(key))
64-
continue
65-
}
6662
const url = convertReactRouterPathToUrl(routes, route)
6763
const node: RawNodeDatum = {
6864
name: url,
@@ -73,7 +69,7 @@ const constructTree = (routes: any, parentId?: string): RawNodeDatum[] => {
7369
errorBoundary: findParentErrorBoundary(route),
7470
children: constructTree(routes, route.id),
7571
}
76-
routeMap.set(key, node)
72+
7773
nodes.push(node)
7874
}
7975
}

0 commit comments

Comments
 (0)