Skip to content

Commit 2d63aef

Browse files
committed
Update filebrowser.js
1 parent 24e91ed commit 2d63aef

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

filebrowser.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,14 @@ async function renderSidebarHTML() {
433433
// if files exist
434434
if (resp.length > 0 || eclipsedFiles.length > 0) {
435435

436-
// show search button
437-
searchButton.classList.remove('hidden');
438-
436+
// if there's more than one file
437+
if ((resp.length + eclipsedFiles.length) > 1) {
438+
439+
// show search button
440+
searchButton.classList.remove('hidden');
441+
442+
}
443+
439444
// render files
440445
resp.forEach(item => {
441446

@@ -575,8 +580,13 @@ async function renderSidebarHTML() {
575580
// if repositories exist
576581
if (resp.length > 0 || Object.keys(modifiedRepos).length > 0) {
577582

578-
// show search button
579-
searchButton.classList.remove('hidden');
583+
// if there's more than one repository
584+
if ((resp.length + Object.keys(modifiedRepos).length) > 1) {
585+
586+
// show search button
587+
searchButton.classList.remove('hidden');
588+
589+
}
580590

581591
// render repositories
582592
resp.forEach(item => {
@@ -1947,8 +1957,13 @@ function createNewFileInHTML() {
19471957
// update repo empty status in local storage
19481958
updateModRepoEmptyStatus(repoObj.fullName, false);
19491959

1950-
// show search button
1951-
searchButton.classList.remove('hidden');
1960+
// if there's more than one file
1961+
if (fileWrapper.querySelectorAll('.item').length > 1) {
1962+
1963+
// show search button
1964+
searchButton.classList.remove('hidden');
1965+
1966+
}
19521967

19531968
}
19541969

0 commit comments

Comments
 (0)