From 84ac44e3b14789e9763b3ff52621c1580b3e4156 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Fri, 24 Oct 2025 01:58:47 +0200 Subject: [PATCH] Add ai bot suggestions --- surfsense_web/components/chat/ChatInterface.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/surfsense_web/components/chat/ChatInterface.tsx b/surfsense_web/components/chat/ChatInterface.tsx index 377d141b4..2d5830fd7 100644 --- a/surfsense_web/components/chat/ChatInterface.tsx +++ b/surfsense_web/components/chat/ChatInterface.tsx @@ -43,6 +43,12 @@ export default function ChatInterface({ searchMode, onSearchModeChange, }: ChatInterfaceProps) { + const [token, setToken] = useState(null); + useEffect(() => { + const bearerToken = localStorage.getItem("surfsense_bearer_token"); + setToken(bearerToken); + }, []); + const { chat_id, search_space_id } = useParams(); const [chatDetails, setChatDetails] = useState(null); const [isChatPannelOpen, setIsChatPannelOpen] = useState(false); @@ -59,7 +65,7 @@ export default function ChatInterface({ const { getPodcastByChatId } = usePodcast(); const { fetchChatDetails } = useChatAPI({ - token: localStorage.getItem("surfsense_bearer_token"), + token, search_space_id: search_space_id as string, });