Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

Fix: Default sidebar to open if cookie is missing

Cursor Agent82a745ab14db
diff --git a/components/layouts/app.tsx b/components/layouts/app.tsx
index a10a72d8..635f7325 100644
--- a/components/layouts/app.tsx
+++ b/components/layouts/app.tsx
@@ -14,7 +14,9 @@ import {
import { BlockingModal } from "./blocking-modal";
export default function AppLayout({ children }: { children: React.ReactNode }) {
- const isSidebarOpen = Cookies.get(SIDEBAR_COOKIE_NAME) === "true";
+ // Default to open (true) if no cookie exists, otherwise use the stored preference
+ const cookieValue = Cookies.get(SIDEBAR_COOKIE_NAME);
+ const isSidebarOpen = cookieValue === undefined ? true : cookieValue === "true";
return (
<SidebarProvider defaultOpen={isSidebarOpen}>