diff --git a/src/components/common/sidebar/index.tsx b/src/components/common/sidebar/index.tsx index cf8e542..5060455 100644 --- a/src/components/common/sidebar/index.tsx +++ b/src/components/common/sidebar/index.tsx @@ -13,11 +13,11 @@ interface SidebarProps extends React.PropsWithChildren { } const Sidebar: React.FC = (props) => { - const [hideSidebar, setHideSidebar] = useState(getLocalStorage('hideSidebar') === 'false') + const [hideSidebar, setHideSidebar] = useState(getLocalStorage('HIDE_SIDEBAR') === 'true') const switchSidebar = () => { + setLocalStorage('HIDE_SIDEBAR', !hideSidebar ? 'true' : 'false') setHideSidebar(!hideSidebar) - setLocalStorage('hideSidebar', hideSidebar ? 'true' : 'false') props.onSidebarSwitch && props.onSidebarSwitch(hideSidebar) }