File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -302,13 +302,18 @@ export class CategoryTreeNode extends TreeNode implements vscode.TreeItem {
302302
303303 override async getChildren ( ) : Promise < TreeNode [ ] > {
304304 await super . getChildren ( ) ;
305- if ( ! this . _prsTreeModel . hasLoaded ) {
306- this . doGetChildren ( ) . then ( ( ) => this . refresh ( this ) ) ;
307- return [ ] ;
305+ const isFirstLoad = ! this . _firstLoad ;
306+ if ( isFirstLoad ) {
307+ this . _firstLoad = this . doGetChildren ( ) ;
308+ if ( ! this . _prsTreeModel . hasLoaded ) {
309+ this . _firstLoad . then ( ( ) => this . refresh ( this ) ) ;
310+ return [ ] ;
311+ }
308312 }
309- return this . doGetChildren ( ) ;
313+ return isFirstLoad ? this . _firstLoad ! : this . doGetChildren ( ) ;
310314 }
311315
316+ private _firstLoad : Promise < TreeNode [ ] > | undefined ;
312317 private async doGetChildren ( ) : Promise < TreeNode [ ] > {
313318 let hasMorePages = false ;
314319 let hasUnsearchedRepositories = false ;
You can’t perform that action at this time.
0 commit comments