diff --git a/src/components/AIChatHistory/ListChatHistory.tsx b/src/components/AIChatHistory/ListChatHistory.tsx index 15cf500c9..f67cf50f5 100644 --- a/src/components/AIChatHistory/ListChatHistory.tsx +++ b/src/components/AIChatHistory/ListChatHistory.tsx @@ -1,18 +1,14 @@ import { useInfiniteQuery } from '@tanstack/react-query'; import { listChatHistoryOptions } from '../../queries/chat-history'; import { queryClient } from '../../stores/query-client'; -import { ChatHistoryItem } from './ChatHistoryItem'; import { Loader2Icon, LockIcon, PanelLeftCloseIcon, PanelLeftIcon, PlusIcon, - SearchIcon, - XIcon, } from 'lucide-react'; import { useEffect, useLayoutEffect, useMemo, useState } from 'react'; -import { useDebounceValue } from '../../hooks/use-debounce'; import { ListChatHistorySkeleton } from './ListChatHistorySkeleton'; import { ChatHistoryError } from './ChatHistoryError'; import { cn } from '../../lib/classname'; @@ -20,6 +16,7 @@ import { getTailwindScreenDimension } from '../../lib/is-mobile'; import { groupChatHistory } from '../../helper/grouping'; import { SearchAIChatHistory } from './SearchAIChatHistory'; import { ChatHistoryGroup } from './ChatHistoryGroup'; +import { isLoggedIn } from '../../lib/jwt'; type ListChatHistoryProps = { activeChatHistoryId?: string; @@ -75,6 +72,10 @@ export function ListChatHistory(props: ListChatHistoryProps) { return groupChatHistory(allHistories ?? []); }, [data?.pages]); + if (!isLoggedIn()) { + return null; + } + if (!isOpen) { return (
@@ -221,19 +222,20 @@ export function UpgradeToProMessage(props: UpgradeToProMessageProps) { const { className, onUpgrade, closeButton } = props; return ( -
- {closeButton && ( -
{closeButton}
- )} +
+
+

Chat History

+ {closeButton} +
- +

Upgrade to Pro to keep your chat history.