Skip to content

Commit 3fed170

Browse files
authored
Update filebrowser.js
1 parent db10207 commit 3fed170

File tree

1 file changed

+13
-36
lines changed

1 file changed

+13
-36
lines changed

filebrowser.js

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,8 @@ async function renderSidebarHTML() {
7272
// get items in current tree from git
7373
resp = await git.getItems(treeLoc);
7474

75-
} catch(e) {
76-
77-
// if failed to get items,
78-
// show login screen
79-
80-
// stop loading
81-
stopLoading();
82-
83-
alert('Whoops, your Github login expired. Log in again?');
84-
85-
sidebar.classList.add('intro');
86-
87-
return;
88-
8975
}
76+
9077

9178
if (resp.message == 'Not Found') {
9279

@@ -969,29 +956,19 @@ async function renderBranchMenuHTML(renderAll) {
969956
// save resp in HTML
970957
setAttr(branchMenu, 'resp', JSON.stringify(cleanedResp));
971958

959+
}
960+
961+
962+
// if repository has more than one branch,
963+
// show branch button
964+
if (branchResp && branchResp.length > 1) {
965+
966+
sidebarBranch.classList.add('visible');
967+
968+
} else {
972969

973-
if (branchResp.length > 1) {
974-
975-
sidebarBranch.classList.add('visible');
976-
977-
} else {
978-
979-
return;
980-
981-
}
982-
983-
} else if (branchResp) {
984-
985-
if (branchResp.length > 1) {
986-
987-
sidebarBranch.classList.add('visible');
988-
989-
} else {
990-
991-
return;
992-
993-
}
994-
970+
return;
971+
995972
}
996973

997974

0 commit comments

Comments
 (0)