Skip to content

Commit 7a364d9

Browse files
authored
Error when reloading the workbench with custom tree views open (#4772)
Fixes #4771
1 parent 5c41f43 commit 7a364d9

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/github/folderRepositoryManager.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@ export class FolderRepositoryManager implements vscode.Disposable {
12531253
query,
12541254
);
12551255
if (includeIssuesWithoutMilestone) {
1256-
const additionalIssues: ItemsResponseResult<IssueModel> = await this.fetchPagedData<IssueModel>(
1256+
const additionalIssues: ItemsResponseResult<Issue> = await this.fetchPagedData<Issue>(
12571257
options,
12581258
'issuesKey',
12591259
PagedDataType.IssuesWithoutMilestone,
@@ -1266,7 +1266,10 @@ export class FolderRepositoryManager implements vscode.Disposable {
12661266
id: '',
12671267
title: NO_MILESTONE,
12681268
},
1269-
issues: additionalIssues.items,
1269+
issues: await Promise.all(additionalIssues.items.map(async (issue) => {
1270+
const githubRepository = await this.getRepoForIssue(issue);
1271+
return new IssueModel(githubRepository, githubRepository.remote, issue);
1272+
})),
12701273
});
12711274
}
12721275
return milestones;

src/github/repositoriesManager.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ export interface PullRequestDefaults {
2828
base: string;
2929
}
3030

31-
export const NO_MILESTONE: string = 'No Milestone';
32-
3331
export class RepositoriesManager implements vscode.Disposable {
3432
static ID = 'RepositoriesManager';
3533

src/github/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,9 @@ export function parseGraphQLIssue(issue: GraphQL.PullRequest, githubRepository:
661661
assignees: issue.assignees?.nodes.map(assignee => parseAuthor(assignee, githubRepository)),
662662
user: parseAuthor(issue.author, githubRepository),
663663
labels: issue.labels.nodes,
664-
repositoryName: issue.repository?.name,
665-
repositoryOwner: issue.repository?.owner.login,
666-
repositoryUrl: issue.repository?.url,
664+
repositoryName: issue.repository?.name ?? githubRepository.remote.repositoryName,
665+
repositoryOwner: issue.repository?.owner.login ?? githubRepository.remote.owner,
666+
repositoryUrl: issue.repository?.url ?? githubRepository.remote.url,
667667
};
668668
}
669669

0 commit comments

Comments
 (0)