mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-10 09:14:45 +08:00
fix: hide chats when sidebar is not open
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
SidebarContent,
|
||||
SidebarFooter,
|
||||
SidebarRail,
|
||||
useSidebar,
|
||||
} from "@/components/ui/sidebar";
|
||||
|
||||
import { RecentChatList } from "./recent-chat-list";
|
||||
@@ -16,6 +17,7 @@ import { WorkspaceNavMenu } from "./workspace-nav-menu";
|
||||
export function WorkspaceSidebar({
|
||||
...props
|
||||
}: React.ComponentProps<typeof Sidebar>) {
|
||||
const { open: isSidebarOpen } = useSidebar();
|
||||
return (
|
||||
<>
|
||||
<Sidebar variant="sidebar" collapsible="icon" {...props}>
|
||||
@@ -24,7 +26,7 @@ export function WorkspaceSidebar({
|
||||
</SidebarHeader>
|
||||
<SidebarContent>
|
||||
<WorkspaceNavChatList />
|
||||
<RecentChatList />
|
||||
{isSidebarOpen && <RecentChatList />}
|
||||
</SidebarContent>
|
||||
<SidebarFooter>
|
||||
<WorkspaceNavMenu />
|
||||
|
||||
Reference in New Issue
Block a user