Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion web/src/hooks/use-agent-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ export function useCancelConversation() {
return { data, loading, cancelConversation: mutateAsync };
}

export const useFetchFlowSSE = (): {
export const useFetchFlowSSE = (enabled: boolean = true): {
data: IFlow;
loading: boolean;
refetch: () => void;
Expand All @@ -807,6 +807,7 @@ export const useFetchFlowSSE = (): {
} = useQuery({
queryKey: [AgentApiAction.FetchFlowDetailSSE],
initialData: {} as IFlow,
enabled: enabled && !!sharedId,
refetchOnReconnect: false,
refetchOnMount: false,
refetchOnWindowFocus: false,
Expand Down
5 changes: 3 additions & 2 deletions web/src/pages/next-chats/share/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@ const ChatContainer = () => {
const sendDisabled = useSendButtonDisabled(value);
const { data: chatInfo } = useFetchExternalChatInfo();

const { data: flowData } = useFetchFlowSSE();
const isAgent = from === SharedFrom.Agent;
const { data: flowData } = useFetchFlowSSE(isAgent);
React.useEffect(() => {
if (locale && i18n.language !== locale) {
changeLanguageAsync(locale);
}
}, [locale, visibleAvatar]);

const avatarDialogSrc =
from === SharedFrom.Agent ? flowData?.avatar : chatInfo.avatar;
isAgent ? flowData?.avatar : chatInfo.avatar;
Comment thread
euvre marked this conversation as resolved.
Outdated

if (!conversationId) {
return <div>empty</div>;
Expand Down
Loading