Skip to content

Commit

Permalink
set default localStorage value if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
muratmerdoglu-dp committed Sep 4, 2024
1 parent ddf24c2 commit 575ba20
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion static/scripts/loggedin.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ if (window.opener && window.opener !== window) {
const sidebar = document.querySelector('.sidebar');
const toggleInTopbar = document.querySelector('.sidebar-toggle-in-topbar');
const toggleInSidebar = document.querySelector('.sidebar-toggle-in-sidebar');
const sideBarExtendedValue = window.localStorage.getItem('sidebarExpanded');
const contentWrapper = document.querySelector('.content-wrapper');
const overlay = document.querySelector('.overlay');
const contentDiv = document.querySelector('.content-min-height');
const sideBarExtendedValue = window.localStorage.getItem('sidebarExpanded');

if (!sideBarExtendedValue) {
window.localStorage.setItem('sidebarExpanded', 'true');
}

function showHideElement(element) {
if (element.style.display === 'none') {
Expand Down

0 comments on commit 575ba20

Please sign in to comment.