Skip to content

Commit 2bf625c

Browse files
committed
Update live-view.js
1 parent a479a57 commit 2bf625c

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

live-view/live-view.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,23 @@ async function setupLiveView() {
44

55
// if URL has a directory
66
if (linkData.dir) {
7-
7+
8+
// update repo obj selected branch
9+
10+
const selBranch = linkData.dir[1].split(':')[1];
11+
12+
// get repo obj from local storage
13+
const repoObj = modifiedRepos[treeLoc[0] + '/' + treeLoc[1].split(':')[0]];
14+
15+
// if repo obj exists
16+
if (repoObj && repoObj.selBranch !== selBranch) {
17+
18+
// update selected branch in local storage
19+
updateModRepoSelectedBranch((treeLoc[0] + '/' + treeLoc[1].split(':')[0]), selBranch);
20+
21+
}
22+
23+
824
// don't transition
925
body.classList.add('notransition');
1026

0 commit comments

Comments
 (0)