File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed
Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -1460,19 +1460,11 @@ export class FolderRepositoryManager extends Disposable {
14601460 }
14611461 }
14621462
1463- async getMaxIssue ( ) : Promise < number > {
1464- const maxIssues = await Promise . all (
1465- this . _githubRepositories . map ( repository => {
1466- return repository . getMaxIssue ( ) ;
1467- } ) ,
1463+ async getMaxIssue ( repository : Repository ) : Promise < number > {
1464+ const ghRepo = this . _githubRepositories . find ( repo =>
1465+ repository . state . remotes . some ( r => r . name === repo . remote . remoteName )
14681466 ) ;
1469- let max : number = 0 ;
1470- for ( const issueNumber of maxIssues ) {
1471- if ( issueNumber !== undefined ) {
1472- max = Math . max ( max , issueNumber ) ;
1473- }
1474- }
1475- return max ;
1467+ return ( await ghRepo ?. getMaxIssue ( ) ) ?? 0 ;
14761468 }
14771469
14781470 async getIssueTemplates ( ) : Promise < vscode . Uri [ ] > {
Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ export class StateManager {
342342 singleRepoState . issueCollection . set ( query . label , items ) ;
343343 }
344344 }
345- singleRepoState . maxIssueNumber = await folderManager . getMaxIssue ( ) ;
345+ singleRepoState . maxIssueNumber = await folderManager . getMaxIssue ( folderManager . repository ) ;
346346 singleRepoState . lastHead = folderManager . repository . state . HEAD ?. commit ;
347347 singleRepoState . lastBranch = folderManager . repository . state . HEAD ?. name ;
348348 }
You can’t perform that action at this time.
0 commit comments