File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6075,11 +6075,7 @@ function isProjectRelatedHash(hash: { cmd: string; arg: string }): boolean {
60756075}
60766076
60776077async function importGithubProject ( repoid : string , requireSignin ?: boolean ) {
6078- if ( ! pxt . appTarget . appTheme . githubEditor || pxt . BrowserUtils . isPxtElectron ( ) ) {
6079- core . warningNotification ( lf ( "Importing GitHub projects not currently supported" ) ) ;
6080- theEditor . openHome ( ) ;
6081- return ;
6082- }
6078+ const githubEnabled = ! ! pxt . appTarget . appTheme . githubEditor && ! pxt . BrowserUtils . isPxtElectron ( ) ;
60836079
60846080 core . showLoading ( "loadingheader" , lf ( "importing GitHub project..." ) ) ;
60856081 try {
@@ -6093,7 +6089,7 @@ async function importGithubProject(repoid: string, requireSignin?: boolean) {
60936089 pxt . github . normalizeRepoId ( h . githubId ) == repoid
60946090 ) ;
60956091 if ( ! hd ) {
6096- if ( requireSignin ) {
6092+ if ( requireSignin && githubEnabled ) {
60976093 const token = await cloudsync . githubProvider ( true ) . routedLoginAsync ( repoid ) ;
60986094 if ( ! token . accessToken ) { // did not sign in, give up
60996095 theEditor . openHome ( ) ;
@@ -6102,8 +6098,14 @@ async function importGithubProject(repoid: string, requireSignin?: boolean) {
61026098 }
61036099 hd = await workspace . importGithubAsync ( repoid ) ;
61046100 }
6105- if ( hd )
6101+ if ( hd ) {
6102+ if ( ! githubEnabled ) {
6103+ hd . githubId = undefined ;
6104+ hd . githubTag = undefined ;
6105+ hd . githubCurrent = false ;
6106+ }
61066107 await theEditor . loadHeaderAsync ( hd , null )
6108+ }
61076109 else
61086110 theEditor . openHome ( ) ;
61096111 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments