@@ -40,7 +40,7 @@ export default class BrowserTree implements IResource<typeof ItemLocation.LOCAL>
4040 await this . absoluteRootPromise
4141 const allAccounts = await ( await Account . getAccountClass ( ) ) . getAllAccounts ( )
4242
43- const recurse = ( node , parentId ?, rng ?) => {
43+ const recurse = ( node , parentId ?, rng ?, parent ? ) => {
4444 const TITLE_BOOKMARKS_BAR = 'Bookmarks Bar' ,
4545 TITLE_OTHER_BOOKMARKS = 'Other Bookmarks' ,
4646 TITLE_BOOKMARKS_MENU = 'Bookmarks Menu' ,
@@ -95,25 +95,30 @@ export default class BrowserTree implements IResource<typeof ItemLocation.LOCAL>
9595 title : parentId ? overrideTitle || node . title : undefined ,
9696 children : node . children
9797 . map ( ( child ) => {
98- return recurse ( child , node . id , rng )
98+ return recurse ( child , node . id , rng , node )
9999 } )
100100 . filter ( child => ! ! child ) // filter out `undefined` from nested accounts
101101 } )
102102 folder . isRoot = isRoot
103103 return folder
104104 } else if ( self . location . protocol === 'moz-extension:' && node . type === 'separator' ) {
105105 // Translate mozilla separators to floccus separators
106- const mockSeparator = ( overrideTitle === TITLE_BOOKMARKS_BAR )
107- ? { title : '' , page : 'vertical.html' }
108- : { title : '⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯' , page : 'index.html' }
106+ let title , page
107+ if ( parent . title === TITLE_BOOKMARKS_BAR ) {
108+ title = ''
109+ page = 'vertical.html'
110+ } else {
111+ title = '⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯'
112+ page = ''
113+ }
109114 return new Tree . Bookmark ( {
110115 location : ItemLocation . LOCAL ,
111116 id : node . id ,
112117 parentId,
113- title : mockSeparator . title ,
118+ title,
114119 // If you have more than a quarter million separators in one folder, call me
115120 // Floccus breaks down much earlier atm
116- url : `https://separator.floccus.org/${ mockSeparator . page } ?id=${ rng . int ( 0 , 1000000 ) } ` ,
121+ url : `https://separator.floccus.org/${ page } ?id=${ rng . int ( 0 , 1000000 ) } ` ,
117122 } )
118123 } else {
119124 return new Tree . Bookmark ( {
0 commit comments