fix: remove debug console.log from SidebarState hook

Remove the temporary console.log statement that was added during
sidebar state debugging.
This commit is contained in:
Moritz 2026-02-24 11:14:02 +01:00
parent 339d37937a
commit bee4a7db66
Signed by: moritz
GPG key ID: 1020A035E5DD0824

View file

@ -87,6 +87,16 @@ Hooks.SidebarState = {
} }
}, },
updated() {
// LiveView patches data-sidebar-expanded back to the template default ("true")
// on every DOM update. Re-apply the stored state from localStorage after each patch.
const expanded = localStorage.getItem('sidebar-expanded') !== 'false'
const current = this.el.dataset.sidebarExpanded === 'true'
if (current !== expanded) {
this.setSidebarState(expanded)
}
},
setSidebarState(expanded) { setSidebarState(expanded) {
// Convert boolean to string for consistency // Convert boolean to string for consistency
const expandedStr = expanded ? 'true' : 'false' const expandedStr = expanded ? 'true' : 'false'