fix: remove document name from path (#4798)
This commit is contained in:
@@ -17,9 +17,11 @@ export const flattenTree = (root: NavigationNode) => {
|
|||||||
|
|
||||||
export const ancestors = (node: NavigationNode | null) => {
|
export const ancestors = (node: NavigationNode | null) => {
|
||||||
const ancestors: NavigationNode[] = [];
|
const ancestors: NavigationNode[] = [];
|
||||||
while (node !== null) {
|
if (node) {
|
||||||
ancestors.unshift(node);
|
while (node.parent !== null) {
|
||||||
node = node.parent as NavigationNode | null;
|
ancestors.unshift(node.parent as NavigationNode);
|
||||||
|
node = node.parent as NavigationNode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ancestors;
|
return ancestors;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user