File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -602,7 +602,7 @@ export class Folder<L extends TItemLocation> {
602602 }
603603
604604 /**
605- * Update the index by removing the given item (this method should be called on the root folder)
605+ * Update the index by removing the given item and its children (this method should be called on the root folder)
606606 */
607607 removeFromIndex ( item : TItem < L > ) {
608608 if ( ! item ) return
@@ -613,7 +613,16 @@ export class Folder<L extends TItemLocation> {
613613 if ( item . parentId ) {
614614 let parentFolder = this . index . folder [ item . parentId ]
615615 while ( parentFolder && this . index . folder [ parentFolder . parentId ] !== parentFolder ) {
616- delete parentFolder . index [ item . type ] [ item . id ]
616+ if ( item instanceof Bookmark ) {
617+ delete parentFolder . index [ item . type ] [ item . id ]
618+ } else {
619+ for ( const folderId in item . index . folder ) {
620+ delete parentFolder . index . folder . folder [ folderId ]
621+ }
622+ for ( const bookmarkId in item . index . bookmark ) {
623+ delete parentFolder . index . folder . bookmark [ bookmarkId ]
624+ }
625+ }
617626 parentFolder = this . index . folder [ parentFolder . parentId ]
618627 }
619628 }
You can’t perform that action at this time.
0 commit comments