Skip to content

Commit

Permalink
fix(sidebar): fix inconsistent sidebar with after page reload
Browse files Browse the repository at this point in the history
  • Loading branch information
salimi-my committed May 21, 2024
1 parent cb63d2a commit a645c34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/(admin)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export default function AdminLayout({
}) {
const sidebar = useStore(useSidebarToggle, (state) => state);

if (!sidebar) return null;

return (
<EdgeStoreProvider>
<Sidebar />
Expand Down
2 changes: 2 additions & 0 deletions components/admin-panel/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { SidebarToggle } from '@/components/admin-panel/sidebar-toggle';
export function Sidebar() {
const sidebar = useStore(useSidebarToggle, (state) => state);

if (!sidebar) return null;

return (
<aside
className={cn(
Expand Down

0 comments on commit a645c34

Please sign in to comment.