@@ -189,6 +189,10 @@ export class WebviewService {
189189 {
190190 find : "@GISTS" ,
191191 replace : "gists"
192+ } ,
193+ {
194+ find : "@SKIP" ,
195+ replace : "skip"
192196 }
193197 ]
194198 }
@@ -316,7 +320,7 @@ export class WebviewService {
316320 }
317321 }
318322
319- public OpenLandingPage ( ) {
323+ public OpenLandingPage ( cmd ?: string ) {
320324 const webview = this . webviews [ 0 ] ;
321325 const releaseNotes = require ( "../../release-notes.json" ) ;
322326 const content : string = this . GenerateContent ( {
@@ -327,7 +331,7 @@ export class WebviewService {
327331 if ( webview . webview ) {
328332 webview . webview . webview . html = content ;
329333 webview . webview . reveal ( ) ;
330- return webview ;
334+ return webview . webview ;
331335 }
332336 const landingPanel = vscode . window . createWebviewPanel (
333337 "landingPage" ,
@@ -341,7 +345,7 @@ export class WebviewService {
341345 landingPanel . webview . onDidReceiveMessage ( async message => {
342346 switch ( message . command ) {
343347 case "loginWithGitHub" :
344- new GitHubOAuthService ( 54321 ) . StartProcess ( ) ;
348+ new GitHubOAuthService ( 54321 ) . StartProcess ( cmd ) ;
345349 const customSettings = await state . commons . GetCustomSettings ( ) ;
346350 const host = customSettings . githubEnterpriseUrl
347351 ? new URL ( customSettings . githubEnterpriseUrl )
@@ -398,17 +402,20 @@ export class WebviewService {
398402 return landingPanel ;
399403 }
400404
401- public OpenGistSelectionpage ( gists : any ) {
405+ public OpenGistSelectionpage ( gists : any , cmd ?: string ) {
402406 const webview = this . webviews [ 2 ] ;
403407 const content : string = this . GenerateContent ( {
404408 content : webview . htmlContent ,
405409 items : webview . replaceables ,
406- gists
410+ gists,
411+ skip : cmd !== "extension.downloadSettings"
412+ ? `<a href="#" onclick="vscode.postMessage({close: true});" title="Skip (new one will be created upon first upload)" class="btn btn-primary mt-4">Skip (new one will be created upon first upload)</a>`
413+ : ""
407414 } ) ;
408415 if ( webview . webview ) {
409416 webview . webview . webview . html = content ;
410417 webview . webview . reveal ( ) ;
411- return webview ;
418+ return webview . webview ;
412419 }
413420 const gistSelectionPanel = vscode . window . createWebviewPanel (
414421 "selectGist" ,
@@ -428,6 +435,9 @@ export class WebviewService {
428435 } else {
429436 gistSelectionPanel . dispose ( ) ;
430437 }
438+ if ( cmd ) {
439+ vscode . commands . executeCommand ( cmd ) ;
440+ }
431441 } ) ;
432442 webview . webview = gistSelectionPanel ;
433443 gistSelectionPanel . onDidDispose ( ( ) => ( webview . webview = null ) ) ;
0 commit comments