0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-08 06:53:35 +02:00

Update web_src/js/features/file-view.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: hamkido <hamki.do2000@gmail.com>
This commit is contained in:
hamkido 2026-01-26 17:17:30 +08:00 committed by GitHub
parent 6a5ea3b2f3
commit 745aceef9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -183,10 +183,18 @@ function initSidebarToggle(elFileView: HTMLElement): void {
const isCurrentlyVisible = !sidebar.classList.contains('sidebar-panel-hidden');
if (isCurrentlyVisible) {
hideSidebar();
localStorage.setItem('file-view-sidebar-visible', 'false');
try {
localStorage.setItem('file-view-sidebar-visible', 'false');
} catch {
// Ignore storage errors (e.g., disabled or full localStorage)
}
} else {
showSidebar();
localStorage.setItem('file-view-sidebar-visible', 'true');
try {
localStorage.setItem('file-view-sidebar-visible', 'true');
} catch {
// Ignore storage errors (e.g., disabled or full localStorage)
}
}
});
}