diff --git a/app/components/DocumentExplorerSearchResult.tsx b/app/components/DocumentExplorerSearchResult.tsx index 094be170f..bb4675851 100644 --- a/app/components/DocumentExplorerSearchResult.tsx +++ b/app/components/DocumentExplorerSearchResult.tsx @@ -73,7 +73,7 @@ const Title = styled(Text)` `; const Path = styled(Text)<{ $selected: boolean }>` - padding-top: 3px; + padding-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; diff --git a/app/utils/tree.ts b/app/utils/tree.ts index 33ccdde76..e5b464f8a 100644 --- a/app/utils/tree.ts +++ b/app/utils/tree.ts @@ -15,11 +15,11 @@ export const flattenTree = (root: NavigationNode) => { return flattened; }; -export const ancestors = (node: NavigationNode) => { +export const ancestors = (node: NavigationNode | null) => { const ancestors: NavigationNode[] = []; - while (node.parent !== null) { + while (node !== null) { ancestors.unshift(node); - node = node.parent as NavigationNode; + node = node.parent as NavigationNode | null; } return ancestors; };