Skip to content

Commit df7554d

Browse files
committed
Improve UX Further
1 parent 76f64a6 commit df7554d

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

src/service/webview.service.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,12 +436,14 @@ export class WebviewService {
436436
} else {
437437
gistSelectionPanel.dispose();
438438
}
439+
});
440+
webview.webview = gistSelectionPanel;
441+
gistSelectionPanel.onDidDispose(() => {
442+
webview.webview = null;
439443
if (cmd) {
440444
vscode.commands.executeCommand(cmd);
441445
}
442446
});
443-
webview.webview = gistSelectionPanel;
444-
gistSelectionPanel.onDidDispose(() => (webview.webview = null));
445447
return gistSelectionPanel;
446448
}
447449

ui/gist-selection/gist-selection.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ appendHTML(skipContainer, skip);
6767
const selectionTemplate = `
6868
<button type="button" onclick="saveGistId('@id')" class="list-group-item list-group-item-action">@description (@id) – Updated @timestamp ago</button>`;
6969

70-
gists
70+
if (!gists.length) {
71+
appendHTML(
72+
selectionContainer,
73+
"<p>No Gists found on your account. Skip this window and upload the settings to create a new Gist.</p>"
74+
);
75+
} else {
76+
gists
7177
.sort((a, b) => new Date(b.updated_at) - new Date(a.updated_at))
7278
.forEach(gist => {
7379
const html = selectionTemplate
@@ -79,3 +85,5 @@ gists
7985
);
8086
appendHTML(selectionContainer, html);
8187
});
88+
}
89+

0 commit comments

Comments
 (0)