Skip to content

Commit ce6afd3

Browse files
committed
fix
1 parent 1211fcf commit ce6afd3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import {pathEscapeSegments, pathUnescapeSegments} from '../utils/url.ts';
44
import {GET, PUT} from '../modules/fetch.ts';
55
import ViewFileTree from '../components/ViewFileTree.vue';
66

7-
async function toggleSidebar(sidebarEl: HTMLElement, visibility: boolean) {
7+
async function toggleSidebar(sidebarEl: HTMLElement, shouldShow: boolean) {
88
const showBtnEl = sidebarEl.parentElement.querySelector('.show-tree-sidebar-button');
99
const containerClassList = sidebarEl.parentElement.classList;
10-
containerClassList.toggle('repo-grid-tree-sidebar', visibility);
11-
containerClassList.toggle('repo-grid-filelist-only', !visibility);
12-
toggleElem(sidebarEl, visibility);
13-
toggleElem(showBtnEl, !visibility);
10+
containerClassList.toggle('repo-grid-tree-sidebar', shouldShow);
11+
containerClassList.toggle('repo-grid-filelist-only', !shouldShow);
12+
toggleElem(sidebarEl, shouldShow);
13+
toggleElem(showBtnEl, !shouldShow);
1414

1515
// FIXME: need to remove "full height" style from parent element
1616

@@ -19,7 +19,7 @@ async function toggleSidebar(sidebarEl: HTMLElement, visibility: boolean) {
1919
// save to session
2020
await PUT('/repo/preferences', {
2121
data: {
22-
show_file_view_tree_sidebar: visibility,
22+
show_file_view_tree_sidebar: shouldShow,
2323
},
2424
});
2525
}

0 commit comments

Comments
 (0)