@@ -1534,40 +1534,46 @@ async function renderBranchMenuHTML(renderAll) {
1534
1534
1535
1535
// if branch menu isn't already rendered
1536
1536
if ( getAttr ( branchMenu , 'tree' ) !== [ user , repoName , contents ] . join ( ) ) {
1537
-
1538
- setAttr ( branchMenu , 'tree' , [ user , repoName , contents ] . join ( ) ) ;
1539
-
1537
+
1540
1538
// show loading message
1541
1539
branchMenu . innerHTML = '<div class="icon selected"><a>Loading...</a></div>' ;
1542
1540
1543
- // if branch resp isn't already stored
1544
- // in local storage
1545
- if ( ! repoObj || ! repoObj . branches ||
1546
- repoObj . branchExpiration === undefined ||
1547
- repoObj . branchExpiration < currentTime ) {
1548
-
1549
- // get branches for repository
1550
- branchResp = await git . getBranches ( treeLoc ) ;
1551
-
1552
- // if repo dosen't exist, return
1553
- if ( branchResp . message ) {
1554
- return ;
1555
- }
1556
-
1557
- // clean resp and save only relevant fields
1558
- const cleanedResp = branchResp . map ( branch => {
1559
- return { name : branch . name , commit : { sha : branch . commit . sha } } ;
1560
- } ) ;
1561
-
1562
- // save branch resp in local storage
1563
- updateModRepoBranches ( fullName , cleanedResp ) ;
1564
-
1565
- // save branch expiration date
1566
- // in local storage
1567
- updateModRepoBranchExpiration ( fullName , dayFromNow ) ;
1568
-
1541
+ setAttr ( branchMenu , 'tree' , [ user , repoName , contents ] . join ( ) ) ;
1542
+
1543
+ }
1544
+
1545
+
1546
+ // if branch resp isn't already stored
1547
+ // in local storage
1548
+ if ( ! repoObj || ! repoObj . branches ||
1549
+ repoObj . branchExpiration === undefined ||
1550
+ repoObj . branchExpiration < currentTime ) {
1551
+
1552
+ // get branches for repository
1553
+ branchResp = await git . getBranches ( treeLoc ) ;
1554
+
1555
+ // if repo dosen't exist, return
1556
+ if ( branchResp . message ) {
1557
+ return ;
1569
1558
}
1570
-
1559
+
1560
+ // clean resp and save only relevant fields
1561
+ const cleanedResp = branchResp . map ( branch => {
1562
+ return {
1563
+ name : branch . name ,
1564
+ commit : {
1565
+ sha : branch . commit . sha
1566
+ }
1567
+ } ;
1568
+ } ) ;
1569
+
1570
+ // save branch resp in local storage
1571
+ updateModRepoBranches ( fullName , cleanedResp ) ;
1572
+
1573
+ // save branch expiration date
1574
+ // in local storage
1575
+ updateModRepoBranchExpiration ( fullName , dayFromNow ) ;
1576
+
1571
1577
}
1572
1578
1573
1579
0 commit comments