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:
parent
339d37937a
commit
bee4a7db66
1 changed files with 10 additions and 0 deletions
|
|
@ -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) {
|
||||
// Convert boolean to string for consistency
|
||||
const expandedStr = expanded ? 'true' : 'false'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue