diff --git a/src/service/webview.service.ts b/src/service/webview.service.ts index 3598aa68..eb605e48 100644 --- a/src/service/webview.service.ts +++ b/src/service/webview.service.ts @@ -348,6 +348,31 @@ export class WebviewService { await state.commons.GetSettings() ); break; + case "downloadPublicGist": + const [extConfig, customConfig] = await Promise.all([ + state.commons.GetSettings(), + state.commons.GetCustomSettings() + ]); + const publicGist = await vscode.window.showInputBox({ + placeHolder: localize("common.placeholder.enterGistId"), + ignoreFocusOut: true + }); + if (!publicGist) { + break; + } + await state.commons.SetCustomSettings({ + ...customConfig, + downloadPublicGist: true + }); + await state.commons.SaveSettings({ + ...extConfig, + gist: publicGist + }); + vscode.window.showInformationMessage( + localize("cmd.otherOptions.warning.tokenNotRequire") + ); + vscode.commands.executeCommand("extension.downloadSettings"); + break; } }); landingPanel.webview.html = content; diff --git a/ui/landing-page/landing-page.html b/ui/landing-page/landing-page.html index a4e309e5..eaac9ca9 100644 --- a/ui/landing-page/landing-page.html +++ b/ui/landing-page/landing-page.html @@ -71,6 +71,14 @@

+
+ Download Public Gist +