File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -150,11 +150,16 @@ async function createLink(notePath: string | undefined, options: CreateLinkOptio
150150 $container . append ( $noteLink ) ;
151151
152152 if ( showNotePath ) {
153- const resolvedPathSegments = ( await treeService . resolveNotePathToSegments ( notePath ) ) || [ ] ;
154- resolvedPathSegments . pop ( ) ; // Remove last element
155-
156- const resolvedPath = resolvedPathSegments . join ( "/" ) ;
157- const pathSegments = await treeService . getNotePathTitleComponents ( resolvedPath ) ;
153+ let pathSegments : string [ ] ;
154+ if ( notePath == "root" ) {
155+ pathSegments = [ "⌂" ] ;
156+ } else {
157+ const resolvedPathSegments = ( await treeService . resolveNotePathToSegments ( notePath ) ) || [ ] ;
158+ resolvedPathSegments . pop ( ) ; // Remove last element
159+
160+ const resolvedPath = resolvedPathSegments . join ( "/" ) ;
161+ pathSegments = await treeService . getNotePathTitleComponents ( resolvedPath ) ;
162+ }
158163
159164 if ( pathSegments ) {
160165 if ( pathSegments . length ) {
You can’t perform that action at this time.
0 commit comments