diff --git a/web/src/context/BusterNotifications/BusterNotifications.tsx b/web/src/context/BusterNotifications/BusterNotifications.tsx index 6c0d34133..a54a0427c 100644 --- a/web/src/context/BusterNotifications/BusterNotifications.tsx +++ b/web/src/context/BusterNotifications/BusterNotifications.tsx @@ -1,5 +1,6 @@ 'use client'; +import { Toaster } from '@/components/ui/toaster/Toaster'; import React, { PropsWithChildren } from 'react'; import { toast, type ExternalToast } from 'sonner'; import { useContextSelector, createContext } from 'use-context-selector'; @@ -167,7 +168,7 @@ export const BusterNotificationsProvider: React.FC = ({ child return ( {children} - {/* */} + ); }; diff --git a/web/src/context/BusterReactQuery/getQueryClient.ts b/web/src/context/BusterReactQuery/getQueryClient.ts index 8ce582f88..d8c73b245 100644 --- a/web/src/context/BusterReactQuery/getQueryClient.ts +++ b/web/src/context/BusterReactQuery/getQueryClient.ts @@ -21,8 +21,8 @@ function makeQueryClient(params?: { enabled: (params?.enabled ?? true) && baseEnabled, queryFn: () => Promise.resolve(), retry: (failureCount, error) => { - if (params?.openErrorNotification && failureCount > 0) { - params.openErrorNotification(error); + if (params?.openErrorNotification) { + // params.openErrorNotification(error); } return false; } diff --git a/web/src/layouts/ChatLayout/ChatContext/ChatContext.tsx b/web/src/layouts/ChatLayout/ChatContext/ChatContext.tsx index 834fabeeb..1a5e73ad6 100644 --- a/web/src/layouts/ChatLayout/ChatContext/ChatContext.tsx +++ b/web/src/layouts/ChatLayout/ChatContext/ChatContext.tsx @@ -4,6 +4,9 @@ import type { SelectedFile } from '../interfaces'; import { useAutoChangeLayout } from './useAutoChangeLayout'; import { useGetChat } from '@/api/buster_rest/chats'; import { useMessageIndividual } from '@/context/Chats'; +import { useQueries } from '@tanstack/react-query'; +import { queryKeys } from '@/api/query_keys'; +import { IBusterChatMessage } from '@/api/asset_interfaces/chat'; const useChatIndividualContext = ({ chatId, @@ -28,7 +31,19 @@ const useChatIndividualContext = ({ //MESSAGES const currentMessageId = chatMessageIds[chatMessageIds.length - 1]; - const isStreamingMessage = useMessageIndividual(currentMessageId, (x) => !x?.isCompletedStream); + + const isStreamingMessage = useQueries({ + queries: chatMessageIds.map((messageId) => { + const queryKey = queryKeys.chatsMessages(messageId); + return { + ...queryKey, + select: (data: IBusterChatMessage | undefined) => !data?.isCompletedStream, + enabled: false + }; + }) + }).some((query) => query.data); + + console.log('isCompletedStreamQueries', isStreamingMessage); useAutoChangeLayout({ lastMessageId: currentMessageId,