diff --git a/client/src/components/UnifiedSidebar/ExpandedPanel.tsx b/client/src/components/UnifiedSidebar/ExpandedPanel.tsx index 471bf2f987..82c85291db 100644 --- a/client/src/components/UnifiedSidebar/ExpandedPanel.tsx +++ b/client/src/components/UnifiedSidebar/ExpandedPanel.tsx @@ -1,5 +1,4 @@ import { memo, useCallback, lazy, Suspense } from 'react'; -import { useRecoilValue } from 'recoil'; import { SquarePen } from 'lucide-react'; import { useLocation } from 'react-router-dom'; import { Skeleton, Sidebar, Button, TooltipAnchor } from '@librechat/client'; @@ -11,17 +10,17 @@ import { CLOSE_SIDEBAR_ID } from '~/components/Chat/Menus/OpenSidebar'; import useNewChat from '~/hooks/Chat/useNewChat'; import { useLocalize } from '~/hooks'; import { cn } from '~/utils'; -import store from '~/store'; const AccountSettings = lazy(() => import('~/components/Nav/AccountSettings')); const NewChatButton = memo(function NewChatButton({ setActive, + switchToHistory, }: { setActive: (id: string) => void; + switchToHistory: boolean; }) { const localize = useLocalize(); - const switchToHistory = useRecoilValue(store.newChatSwitchToHistory); const tooltipDescription = useShortcutHint('newChat', localize('com_ui_new_chat')); const ariaKey = useShortcutAriaKey('newChat'); @@ -129,6 +128,7 @@ function ExpandedPanel({ onExpand, onNavigate, onLeaveInsights, + switchToHistory, }: { links: NavLink[]; expanded?: boolean; @@ -136,6 +136,7 @@ function ExpandedPanel({ onExpand?: () => void; onNavigate?: () => void; onLeaveInsights?: () => void; + switchToHistory: boolean; }) { const localize = useLocalize(); const location = useLocation(); @@ -169,7 +170,7 @@ function ExpandedPanel({ } /> - +
diff --git a/client/src/components/UnifiedSidebar/Sidebar.tsx b/client/src/components/UnifiedSidebar/Sidebar.tsx index 319b6651ad..ef048b6c60 100644 --- a/client/src/components/UnifiedSidebar/Sidebar.tsx +++ b/client/src/components/UnifiedSidebar/Sidebar.tsx @@ -13,6 +13,7 @@ function Sidebar({ onCollapse, onExpand, onLeaveInsights, + switchToHistory, onResizeStart, onResizeKeyboard, }: { @@ -24,6 +25,7 @@ function Sidebar({ onCollapse: () => void; onExpand: () => void; onLeaveInsights: () => void; + switchToHistory: boolean; onResizeStart: (e: React.MouseEvent) => void; onResizeKeyboard: (direction: 'shrink' | 'grow') => void; }) { @@ -36,6 +38,7 @@ function Sidebar({ onCollapse={onCollapse} onExpand={onExpand} onLeaveInsights={onLeaveInsights} + switchToHistory={switchToHistory} />