@@ -36,30 +36,18 @@ window.onload = async () => {
3636 changeSelectedFile ( treeLoc . join ( ) , fileSha , fileName , '\n\r' , getFileLang ( fileName ) ,
3737 [ 0 , 0 ] , [ 0 , 0 ] , false ) ;
3838
39- // if file is not modified; fetch from Git
40- if ( ! modifiedFiles [ fileSha ] ) {
41-
42- // start loading
43- startLoading ( ) ;
44-
45- // get file from git
46- const resp = await git . getFile ( treeLoc , fileName ) ;
47-
48- // change selected file
49- changeSelectedFile ( treeLoc . join ( ) , fileSha , fileName , resp . content , getFileLang ( fileName ) ,
50- [ 0 , 0 ] , [ 0 , 0 ] , false ) ;
51-
52- // stop loading
53- stopLoading ( ) ;
54-
55- } else { // else, load file from modifiedFiles object
39+ // start loading
40+ startLoading ( ) ;
5641
57- const modFile = modifiedFiles [ fileSha ] ;
42+ // get file from git
43+ const resp = await git . getFile ( treeLoc , fileName ) ;
5844
59- changeSelectedFile ( modFile . dir , modFile . sha , modFile . name , modFile . content , modFile . lang ,
60- modFile . caretPos , modFile . scrollPos , false ) ;
45+ // change selected file
46+ changeSelectedFile ( treeLoc . join ( ) , fileSha , fileName , resp . content , getFileLang ( fileName ) ,
47+ [ 0 , 0 ] , [ 0 , 0 ] , false ) ;
6148
62- }
49+ // stop loading
50+ stopLoading ( ) ;
6351
6452 // expand bottom float
6553 bottomWrapper . classList . add ( 'expanded' ) ;
0 commit comments