@@ -176,6 +176,9 @@ async function renderSidebarHTML() {
176176 // show title
177177 sidebarLogo . innerText = 'Repositories' ;
178178
179+ // hide branch button
180+ sidebarBranch . classList . remove ( 'visible' ) ;
181+
179182
180183 // scroll to start of title
181184 sidebarLogo . scrollTo ( 0 , 0 ) ;
@@ -206,6 +209,9 @@ async function renderSidebarHTML() {
206209 // change sidebar title
207210 sidebarLogo . innerText = 'Repositories' ;
208211
212+ // hide branch button
213+ sidebarBranch . classList . remove ( 'visible' ) ;
214+
209215 // scroll to start of repo name
210216 sidebarLogo . scrollTo ( 0 , 0 ) ;
211217 scrolledSidebarTitle ( ) ;
@@ -413,6 +419,9 @@ async function renderSidebarHTML() {
413419 // show title
414420 sidebarLogo . innerText = 'Repositories' ;
415421
422+ // hide branch button
423+ sidebarBranch . classList . remove ( 'visible' ) ;
424+
416425 // scroll to start of repo name
417426 sidebarLogo . scrollTo ( 0 , 0 ) ;
418427 sidebarLogo . classList . add ( 'notransition' ) ;
@@ -567,9 +576,6 @@ async function renderSidebarHTML() {
567576 // change header options
568577 header . classList . add ( 'out-of-repo' ) ;
569578
570- // hide branch button
571- sidebarBranch . classList . remove ( 'visible' ) ;
572-
573579
574580 // get rendered repos
575581 let renderedRepos = { } ;
@@ -642,7 +648,9 @@ async function renderSidebarHTML() {
642648 const modRepo = modifiedRepos [ modRepoName ] ;
643649
644650 // if repo isn't rendered
645- if ( ! renderedRepos [ modRepoName ] ) {
651+ // and user has push access in repo
652+ if ( ! renderedRepos [ modRepoName ]
653+ && modRepo . pushAccess ) {
646654
647655 // render repo
648656
@@ -1260,7 +1268,7 @@ async function renderBranchMenuHTML(renderAll) {
12601268 // check if repository object exists
12611269
12621270 const fullName = user + '/' + repoName ;
1263- const repoObj = modifiedRepos [ fullName ] ;
1271+ let repoObj = modifiedRepos [ fullName ] ;
12641272
12651273 let branchResp ;
12661274
@@ -1329,16 +1337,20 @@ async function renderBranchMenuHTML(renderAll) {
13291337 // if selected branch is not defined
13301338 if ( ! selectedBranch ) {
13311339
1340+ repoObj = modifiedRepos [ fullName ] ;
1341+
13321342 // if default branch isn't fetched yet
13331343 if ( ! repoObj . selBranch ) {
1334-
1344+
13351345 // await fetch
13361346 await repoPromise ;
1337-
1347+
1348+ repoObj = modifiedRepos [ fullName ] ;
1349+
13381350 }
13391351
13401352 // add branch to tree
1341- treeLoc [ 1 ] = repo . split ( ':' ) [ 0 ] + ':' + repoObj . selBranch ;
1353+ treeLoc [ 1 ] = repo + ':' + repoObj . selBranch ;
13421354 saveTreeLocLS ( treeLoc ) ;
13431355
13441356 // update selected branch
0 commit comments