File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export class PostCatTreeDataProvider implements TreeDataProvider<PostCatListTree
51
51
if ( this . isLoading ) return Promise . resolve ( [ ] )
52
52
53
53
if ( item === undefined ) {
54
- return PostCatService . getAll ( ) . then ( list => list . map ( c => new PostCatTreeItem ( c ) ) )
54
+ return this . getRoots ( )
55
55
} else if ( item instanceof PostCatTreeItem ) {
56
56
const categoryId = item . category . categoryId
57
57
return Promise . all ( [ this . getCategories ( categoryId ) , this . getPost ( item ) ] ) . then (
@@ -93,6 +93,11 @@ export class PostCatTreeDataProvider implements TreeDataProvider<PostCatListTree
93
93
} )
94
94
}
95
95
96
+ private async getRoots ( ) {
97
+ this . _roots = await PostCatService . getAll ( ) . then ( list => list . map ( c => new PostCatTreeItem ( c ) ) )
98
+ return this . _roots
99
+ }
100
+
96
101
private async getPost ( parent : PostCatTreeItem ) : Promise < PostTreeItem [ ] > {
97
102
const catId = parent . category . categoryId
98
103
You can’t perform that action at this time.
0 commit comments