File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -84,10 +84,13 @@ export function initViewFileTreeSidebar() {
8484 } } ) ;
8585 fileTreeView . mount ( fileTree ) ;
8686
87- window . addEventListener ( 'popstate' , ( ) => {
88- selectedItem . value = getSelectedPath ( refString ) ;
89- loadContent ( el ) ;
90- } ) ;
87+ if ( ! window . popstateListenerForViewFilePageAdded ) {
88+ window . addEventListener ( 'popstate' , ( ) => {
89+ selectedItem . value = getSelectedPath ( refString ) ;
90+ loadContent ( el ) ;
91+ } ) ;
92+ window . popstateListenerForViewFilePageAdded = true ;
93+ }
9194 } ) ;
9295}
9396
Original file line number Diff line number Diff line change @@ -74,5 +74,6 @@ interface Window {
7474 turnstile : any ,
7575 hcaptcha : any ,
7676 codeEditors : any [ ] ,
77+ popstateListenerForViewFilePageAdded : boolean ,
7778 updateCloneStates : ( ) => void ,
7879}
You can’t perform that action at this time.
0 commit comments