Skip to content

Commit 3bc3cd8

Browse files
committed
no window var
1 parent 31835f4 commit 3bc3cd8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

web_src/js/features/repo-view-file-tree-sidebar.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ function reloadContentScript(sidebarEl: HTMLElement, contentEl: Element) {
5757
}
5858

5959
export function initViewFileTreeSidebar() {
60+
let popstateListenerForViewFilePageAdded = false;
6061
registerGlobalInitFunc('initViewFileTreeSidebar', async (el: HTMLElement) => {
6162
el.querySelector('.hide-tree-sidebar-button').addEventListener('click', () => {
6263
toggleSidebar(el, false);
@@ -84,12 +85,12 @@ export function initViewFileTreeSidebar() {
8485
}});
8586
fileTreeView.mount(fileTree);
8687

87-
if (!window.popstateListenerForViewFilePageAdded) {
88+
if (!popstateListenerForViewFilePageAdded) {
8889
window.addEventListener('popstate', () => {
8990
selectedItem.value = getSelectedPath(refString);
9091
loadContent(el);
9192
});
92-
window.popstateListenerForViewFilePageAdded = true;
93+
popstateListenerForViewFilePageAdded = true;
9394
}
9495
});
9596
}

web_src/js/globals.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,5 @@ interface Window {
7474
turnstile: any,
7575
hcaptcha: any,
7676
codeEditors: any[],
77-
popstateListenerForViewFilePageAdded: boolean,
7877
updateCloneStates: () => void,
7978
}

0 commit comments

Comments
 (0)