@@ -155,10 +155,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
155155 processTemplateResponse ( )
156156 } , [ location ] )
157157
158- useEffect ( ( ) => {
159- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : appStateContext ?. state . isGenerating } )
160- } , [ isLoading ] )
161-
162158 useEffect ( ( ) => {
163159 if (
164160 appStateContext ?. state . isCosmosDBAvailable ?. status !== CosmosDBStatus . Working &&
@@ -283,7 +279,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
283279
284280 const makeApiRequestWithoutCosmosDB = async ( question : string , conversationId ?: string ) => {
285281 setIsLoading ( true )
286- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : true } )
287282 setShowLoadingMessage ( true )
288283 const abortController = new AbortController ( )
289284 abortFuncs . current . unshift ( abortController )
@@ -400,7 +395,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
400395 } finally {
401396 setIsLoading ( false )
402397 setShowLoadingMessage ( false )
403- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : false } )
404398 abortFuncs . current = abortFuncs . current . filter ( a => a !== abortController )
405399 setProcessMessages ( messageStatus . Done )
406400 }
@@ -410,7 +404,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
410404
411405 const makeApiRequestWithCosmosDB = async ( question : string , conversationId ?: string ) => {
412406 setIsLoading ( true )
413- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : true } )
414407 setShowLoadingMessage ( true )
415408 const abortController = new AbortController ( )
416409 abortFuncs . current . unshift ( abortController )
@@ -430,7 +423,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
430423 if ( ! conversation ) {
431424 console . error ( 'Conversation not found.' )
432425 setIsLoading ( false )
433- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : false } )
434426 setShowLoadingMessage ( false )
435427 abortFuncs . current = abortFuncs . current . filter ( a => a !== abortController )
436428 return
@@ -476,7 +468,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
476468 } else {
477469 setMessages ( [ ...messages , userMessage , errorChatMsg ] )
478470 setIsLoading ( false )
479- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : false } )
480471 setShowLoadingMessage ( false )
481472 abortFuncs . current = abortFuncs . current . filter ( a => a !== abortController )
482473 return
@@ -538,7 +529,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
538529 if ( ! resultConversation ) {
539530 console . error ( 'Conversation not found.' )
540531 setIsLoading ( false )
541- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : false } )
542532 setShowLoadingMessage ( false )
543533 abortFuncs . current = abortFuncs . current . filter ( a => a !== abortController )
544534 return
@@ -559,7 +549,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
559549 }
560550 if ( ! resultConversation ) {
561551 setIsLoading ( false )
562- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : false } )
563552 setShowLoadingMessage ( false )
564553 abortFuncs . current = abortFuncs . current . filter ( a => a !== abortController )
565554 return
@@ -593,7 +582,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
593582 if ( ! resultConversation ) {
594583 console . error ( 'Conversation not found.' )
595584 setIsLoading ( false )
596- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : false } )
597585 setShowLoadingMessage ( false )
598586 abortFuncs . current = abortFuncs . current . filter ( a => a !== abortController )
599587 return
@@ -610,7 +598,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
610598 }
611599 setMessages ( [ ...messages , userMessage , errorChatMsg ] )
612600 setIsLoading ( false )
613- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : false } )
614601 setShowLoadingMessage ( false )
615602 abortFuncs . current = abortFuncs . current . filter ( a => a !== abortController )
616603 return
@@ -625,7 +612,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
625612 }
626613 if ( ! resultConversation ) {
627614 setIsLoading ( false )
628- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : false } )
629615 setShowLoadingMessage ( false )
630616 abortFuncs . current = abortFuncs . current . filter ( a => a !== abortController )
631617 return
@@ -761,7 +747,6 @@ const Chat = ({ type = ChatType.Browse }: Props) => {
761747 abortFuncs . current . forEach ( a => a . abort ( ) )
762748 setShowLoadingMessage ( false )
763749 setIsLoading ( false )
764- appStateContext ?. dispatch ( { type : 'GENERATE_ISLODING' , payload : false } )
765750 }
766751
767752 useEffect ( ( ) => {
0 commit comments