diff --git a/src/service/webview.service.ts b/src/service/webview.service.ts index 20af74a4..7d31f5b6 100644 --- a/src/service/webview.service.ts +++ b/src/service/webview.service.ts @@ -436,12 +436,14 @@ export class WebviewService { } else { gistSelectionPanel.dispose(); } + }); + webview.webview = gistSelectionPanel; + gistSelectionPanel.onDidDispose(() => { + webview.webview = null; if (cmd) { vscode.commands.executeCommand(cmd); } }); - webview.webview = gistSelectionPanel; - gistSelectionPanel.onDidDispose(() => (webview.webview = null)); return gistSelectionPanel; } diff --git a/ui/gist-selection/gist-selection.js b/ui/gist-selection/gist-selection.js index 80a8a04f..00b0dd6a 100644 --- a/ui/gist-selection/gist-selection.js +++ b/ui/gist-selection/gist-selection.js @@ -67,7 +67,13 @@ appendHTML(skipContainer, skip); const selectionTemplate = ` `; -gists +if (!gists.length) { + appendHTML( + selectionContainer, + "

No Gists found on your account. Skip this window and upload the settings to create a new Gist.

" + ); +} else { + gists .sort((a, b) => new Date(b.updated_at) - new Date(a.updated_at)) .forEach(gist => { const html = selectionTemplate @@ -79,3 +85,5 @@ gists ); appendHTML(selectionContainer, html); }); +} +