Skip to content

Commit 73c7afe

Browse files
committed
Update filebrowser.js
1 parent 4af108e commit 73c7afe

File tree

1 file changed

+6
-31
lines changed

1 file changed

+6
-31
lines changed

filebrowser.js

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

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-
} else {
443-
444-
// hide search button
445-
searchButton.classList.add('hidden');
446-
447-
}
436+
// show search button
437+
searchButton.classList.remove('hidden');
448438

449439
// render files
450440
resp.forEach(item => {
@@ -585,18 +575,8 @@ async function renderSidebarHTML() {
585575
// if repositories exist
586576
if (resp.length > 0 || Object.keys(modifiedRepos).length > 0) {
587577

588-
// if there's more than one repository
589-
if ((resp.length + Object.keys(modifiedRepos).length) > 1) {
590-
591-
// show search button
592-
searchButton.classList.remove('hidden');
593-
594-
} else {
595-
596-
// hide search button
597-
searchButton.classList.add('hidden');
598-
599-
}
578+
// show search button
579+
searchButton.classList.remove('hidden');
600580

601581
// render repositories
602582
resp.forEach(item => {
@@ -1967,13 +1947,8 @@ function createNewFileInHTML() {
19671947
// update repo empty status in local storage
19681948
updateModRepoEmptyStatus(repoObj.fullName, false);
19691949

1970-
// if there's more than one file
1971-
if (fileWrapper.querySelectorAll('.item').length > 1) {
1972-
1973-
// show search button
1974-
searchButton.classList.remove('hidden');
1975-
1976-
}
1950+
// show search button
1951+
searchButton.classList.remove('hidden');
19771952

19781953
}
19791954

0 commit comments

Comments
 (0)