Skip to content

Commit

Permalink
chore: fix bug with sidebar always expanded on refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickDinh committed Mar 15, 2024
1 parent e0a9efc commit 775fc5f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/features/layout/context/layout-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ export const LayoutProviderContext = createContext<LayoutProviderState>(initialS
export function LayoutProvider({ children, ...props }: LayoutProviderProps) {
const leftSideBarExpandedKey = 'layout-config-left-side-bar-expanded'

const [isLeftSideBarExpanded, setIsLeftSideBarExpanded] = useState<boolean>(
() => localStorage.getItem(leftSideBarExpandedKey) === 'true' || true
)
const [isLeftSideBarExpanded, setIsLeftSideBarExpanded] = useState<boolean>(() => localStorage.getItem(leftSideBarExpandedKey) === 'true')

const value = {
isLeftSideBarExpanded,
Expand Down

0 comments on commit 775fc5f

Please sign in to comment.