Skip to content

Commit 89e7fcd

Browse files
committed
Update filebrowser.js
1 parent 34040a6 commit 89e7fcd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

filebrowser.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,8 @@ async function loadFileInHTML(fileEl, fileSha) {
10581058

10591059

10601060
// if file is not modified; fetch from Git
1061-
if (!modifiedFiles[fileSha]) {
1061+
if (!modifiedFiles[fileSha]
1062+
|| (modifiedFiles[fileSha] && modifiedFiles[fileSha].dir !== treeLoc.join(',')) {
10621063

10631064
// if not already loading, start loading
10641065
if (loader.style.opacity != '1') {
@@ -2481,6 +2482,13 @@ function protectUnsavedCode() {
24812482
// load file
24822483
loadFileInHTML(selectedElSha, getAttr(selectedElSha, 'sha'));
24832484

2485+
} else if (selBranch !== branch) {
2486+
2487+
// if selected file is from another branch
2488+
2489+
// load file
2490+
loadFileInHTML(selectedElSha, getAttr(selectedElSha, 'sha'));
2491+
24842492
}
24852493

24862494
}

0 commit comments

Comments
 (0)