mirror of https://github.com/buster-so/buster.git
put toaster back in place
This commit is contained in:
parent
8cfccc7bc1
commit
e8081b0df1
|
@ -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>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue