Skip to content

Commit

Permalink
fetching pull requests failed in infinite loop when proxy is unavaila…
Browse files Browse the repository at this point in the history
…ble (#6568)

Fixes #6063
  • Loading branch information
alexr00 authored Dec 19, 2024
1 parent ce0a7fa commit bd9df0a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/view/treeNodes/categoryNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,18 @@ export class CategoryTreeNode extends TreeNode implements vscode.TreeItem {

override async getChildren(): Promise<TreeNode[]> {
await super.getChildren();
if (!this._prsTreeModel.hasLoaded) {
this.doGetChildren().then(() => this.refresh(this));
return [];
const isFirstLoad = !this._firstLoad;
if (isFirstLoad) {
this._firstLoad = this.doGetChildren();
if (!this._prsTreeModel.hasLoaded) {
this._firstLoad.then(() => this.refresh(this));
return [];
}
}
return this.doGetChildren();
return isFirstLoad ? this._firstLoad! : this.doGetChildren();
}

private _firstLoad: Promise<TreeNode[]> | undefined;
private async doGetChildren(): Promise<TreeNode[]> {
let hasMorePages = false;
let hasUnsearchedRepositories = false;
Expand Down

0 comments on commit bd9df0a

Please sign in to comment.