Skip to content

Commit 55e15d0

Browse files
committed
Update filebrowser.js
1 parent f34f6d8 commit 55e15d0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

filebrowser.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,20 @@ async function renderSidebarHTML() {
277277

278278
// if couldn't find branch, show not found screen
279279

280-
const defaultBranch = (await git.getRepo(treeLoc)).default_branch;
280+
// get repo obj from local storage
281+
const repoObj = modifiedRepos[user + '/' + repoName];
282+
let defaultBranch;
283+
284+
if (repoObj && repoObj.defaultBranch) {
285+
286+
defaultBranch = repoObj.defaultBranch;
287+
288+
} else {
289+
290+
defaultBranch = (await git.getRepo(treeLoc)).default_branch;
291+
292+
}
293+
281294

282295
// stop loading
283296
stopLoading();

0 commit comments

Comments
 (0)