@@ -13,7 +13,6 @@ import { trackLLMCall } from "@/lib/analytics";
1313import { FILE_CONFIRMATION , FILES_REGEX } from "@/lib/constants" ;
1414import { buildSearchPayloadFilters } from "@/lib/filter-normalization" ;
1515import { cn } from "@/lib/utils" ;
16- import { useLoadingStore } from "@/stores/loadingStore" ;
1716import { useGetConversationsQuery } from "../api/queries/useGetConversationsQuery" ;
1817import { useGetNudgesQuery } from "../api/queries/useGetNudgesQuery" ;
1918import { useGetSettingsQuery } from "../api/queries/useGetSettingsQuery" ;
@@ -32,7 +31,6 @@ import type {
3231
3332function ChatPage ( ) {
3433 const isDebugMode = process . env . NEXT_PUBLIC_OPENRAG_DEBUG === "true" ;
35- const isCloudBrand = useIsCloudBrand ( ) ;
3634 const {
3735 endpoint,
3836 setEndpoint,
@@ -50,6 +48,8 @@ function ChatPage() {
5048 placeholderConversation,
5149 conversationFilter,
5250 setConversationFilter,
51+ loading,
52+ setLoading,
5353 } = useChat ( ) ;
5454 const [ messages , setMessages ] = useState < Message [ ] > ( [
5555 {
@@ -59,7 +59,6 @@ function ChatPage() {
5959 } ,
6060 ] ) ;
6161 const [ input , setInput ] = useState ( "" ) ;
62- const { loading, setLoading } = useLoadingStore ( ) ;
6362 const { setChatError } = useChat ( ) ;
6463 const [ asyncMode , setAsyncMode ] = useState ( true ) ;
6564 const [ expandedFunctionCalls , setExpandedFunctionCalls ] = useState <
@@ -109,7 +108,7 @@ function ChatPage() {
109108 streamingMessage,
110109 sendMessage : sendStreamingMessage ,
111110 abortStream,
112- isLoading : isStreamLoading ,
111+ isLoading : isChatStreaming ,
113112 } = useChatStreaming ( {
114113 endpoint : apiEndpoint ,
115114 onComplete : ( message , responseId ) => {
@@ -169,7 +168,7 @@ function ChatPage() {
169168 useEffect ( ( ) => {
170169 let timeoutId : NodeJS . Timeout | null = null ;
171170
172- if ( isStreamLoading && ! streamingMessage ) {
171+ if ( isChatStreaming && ! streamingMessage ) {
173172 timeoutId = setTimeout ( ( ) => {
174173 setWaitingTooLong ( true ) ;
175174 } , 20000 ) ; // 20 seconds
@@ -180,7 +179,7 @@ function ChatPage() {
180179 return ( ) => {
181180 if ( timeoutId ) clearTimeout ( timeoutId ) ;
182181 } ;
183- } , [ isStreamLoading , streamingMessage ] ) ;
182+ } , [ isChatStreaming , streamingMessage ] ) ;
184183
185184 const handleEndpointChange = ( newEndpoint : EndpointType ) => {
186185 setEndpoint ( newEndpoint ) ;
@@ -372,7 +371,7 @@ function ChatPage() {
372371
373372 if (
374373 conversationData ?. messages &&
375- ( isNewConversation || ( ! isStreamLoading && hasMessageCountChanged ) ) &&
374+ ( isNewConversation || ( ! isChatStreaming && hasMessageCountChanged ) ) &&
376375 ! isUserInteracting &&
377376 ! isForkingInProgress
378377 ) {
@@ -564,7 +563,7 @@ function ChatPage() {
564563 isUserInteracting ,
565564 isForkingInProgress ,
566565 setPreviousResponseIds ,
567- isStreamLoading ,
566+ isChatStreaming ,
568567 messages . length ,
569568 ] ) ;
570569
0 commit comments