File tree Expand file tree Collapse file tree 1 file changed +22
-7
lines changed
Expand file tree Collapse file tree 1 file changed +22
-7
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments