File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed
Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -632,6 +632,14 @@ export class GitHubRepository implements vscode.Disposable {
632632 return undefined ;
633633 }
634634
635+ async canGetProjectsNow ( ) : Promise < boolean > {
636+ let { schema } = await this . ensure ( ) ;
637+ if ( schema . GetRepoProjects && schema . GetOrgProjects ) {
638+ return true ;
639+ }
640+ return false ;
641+ }
642+
635643 async getOrgProjects ( ) : Promise < IProject [ ] > {
636644 Logger . debug ( `Fetch org projects - enter` , GitHubRepository . ID ) ;
637645 let { query, remote, schema } = await this . ensure ( ) ;
Original file line number Diff line number Diff line change @@ -250,15 +250,16 @@ export async function extractMetadataFromFile(repositoriesManager: RepositoriesM
250250 if ( text . startsWith ( PROJECTS ) ) {
251251 const lines = text . split ( / \r \n | \n / , 1 ) ;
252252 if ( lines . length === 1 ) {
253- const repoProjects = await folderManager . getAllProjects ( repo ) ;
254- projects = lines [ 0 ] . substring ( PROJECTS . length )
255- . split ( ',' )
256- . map ( value => {
257- value = value . trim ( ) ;
258- return repoProjects . find ( project => project . title === value ) ;
259- } )
260- . filter < IProject > ( ( project ) : project is IProject => ! ! project ) ;
261-
253+ if ( await repo . canGetProjectsNow ( ) ) {
254+ const repoProjects = await folderManager . getAllProjects ( repo ) ;
255+ projects = lines [ 0 ] . substring ( PROJECTS . length )
256+ . split ( ',' )
257+ . map ( value => {
258+ value = value . trim ( ) ;
259+ return repoProjects . find ( project => project . title === value ) ;
260+ } )
261+ . filter < IProject > ( ( project ) : project is IProject => ! ! project ) ;
262+ }
262263 text = text . substring ( lines [ 0 ] . length ) . trim ( ) ;
263264 }
264265 }
You can’t perform that action at this time.
0 commit comments