put toaster back in place

This commit is contained in:
Nate Kelley 2025-03-11 09:59:37 -06:00
parent 8cfccc7bc1
commit e8081b0df1
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 20 additions and 4 deletions

View File

@ -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<PropsWithChildren> = ({ child
return (
<BusterNotifications.Provider value={value}>
{children}
{/* <Toaster /> */}
<Toaster />
</BusterNotifications.Provider>
);
};

View File

@ -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;
}

View File

@ -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,