Skip to content

Commit ef3fbcc

Browse files
committed
fix: hide snippets count when no snippets are present
1 parent 177de74 commit ef3fbcc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/extensionsIntegrated/CustomSnippets/src/UIHelper.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ define(function (require, exports, module) {
8686

8787
// add the snippet count in the toolbar (the no. of snippets added)
8888
const snippetCount = Global.SnippetHintsList.length;
89-
$toolbarTitle.html(`Custom Snippets <span id="snippets-count" class="snippets-count">(${snippetCount})</span>`);
89+
const countText = snippetCount > 0 ? `(${snippetCount})` : "";
90+
$toolbarTitle.html(`Custom Snippets <span id="snippets-count" class="snippets-count">${countText}</span>`);
9091

9192
$("#filter-snippets-input").val("");
9293
}
@@ -172,7 +173,8 @@ define(function (require, exports, module) {
172173
function initializeListViewToolbarTitle() {
173174
const $toolbarTitle = $(".toolbar-title");
174175
const snippetCount = Global.SnippetHintsList.length;
175-
$toolbarTitle.html(`Custom Snippets <span id="snippets-count" class="snippets-count">(${snippetCount})</span>`);
176+
const countText = snippetCount > 0 ? `(${snippetCount})` : "";
177+
$toolbarTitle.html(`Custom Snippets <span id="snippets-count" class="snippets-count">${countText}</span>`);
176178
}
177179

178180
exports.showEmptySnippetMessage = showEmptySnippetMessage;

0 commit comments

Comments
 (0)