diff --git a/apps/web/app/(app)/[emailAccountId]/assistant/AIChatButton.tsx b/apps/web/app/(app)/[emailAccountId]/assistant/AIChatButton.tsx index e17c8827e0..7ae5f195f6 100644 --- a/apps/web/app/(app)/[emailAccountId]/assistant/AIChatButton.tsx +++ b/apps/web/app/(app)/[emailAccountId]/assistant/AIChatButton.tsx @@ -5,13 +5,18 @@ import { useSidebar } from "@/components/ui/sidebar"; import { MessageCircleIcon } from "lucide-react"; export function AIChatButton() { - const { setOpen } = useSidebar(); + const { setOpen, setOpenMobile, isMobile } = useSidebar(); return ( @@ -190,7 +190,7 @@ function RulesPromptForm({ diff --git a/apps/web/components/SidebarRight.tsx b/apps/web/components/SidebarRight.tsx index 2e45c8c033..a3ecae20c6 100644 --- a/apps/web/components/SidebarRight.tsx +++ b/apps/web/components/SidebarRight.tsx @@ -11,14 +11,14 @@ export function SidebarRight({ name: string; className?: string; }) { - const { state } = useSidebar(); - const isOpen = state.includes(name); + const { state, openMobile, isMobile } = useSidebar(); + const isOpen = isMobile ? openMobile.includes(name) : state.includes(name); return (