소스 검색

feat: When voice is turned on, the page will not display an empty reply message when the answer is empty #1877 (#2447)

### What problem does this PR solve?

feat: When voice is turned on, the page will not display an empty reply
message when the answer is empty #1877

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
tags/v0.11.0
balibabu 1 년 전
부모
커밋
2f33ec7ad0
No account linked to committer's email address
2개의 변경된 파일13개의 추가작업 그리고 4개의 파일을 삭제
  1. 12
    3
      web/src/hooks/chat-hooks.ts
  2. 1
    1
      web/src/pages/chat/hooks.ts

+ 12
- 3
web/src/hooks/chat-hooks.ts 파일 보기

@@ -95,7 +95,12 @@ export const useSetNextDialog = () => {
mutationFn: async (params: IDialog) => {
const { data } = await chatService.setDialog(params);
if (data.retcode === 0) {
queryClient.invalidateQueries({ queryKey: ['fetchDialogList'] });
queryClient.invalidateQueries({
queryKey: ['fetchDialogList'],
});
queryClient.invalidateQueries({
queryKey: ['fetchDialog'],
});
message.success(
i18n.t(`message.${params.dialog_id ? 'modified' : 'created'}`),
);
@@ -110,7 +115,11 @@ export const useSetNextDialog = () => {
export const useFetchNextDialog = () => {
const { dialogId } = useGetChatSearchParams();

const { data, isFetching: loading } = useQuery<IDialog>({
const {
data,
isFetching: loading,
refetch,
} = useQuery<IDialog>({
queryKey: ['fetchDialog', dialogId],
gcTime: 0,
initialData: {} as IDialog,
@@ -123,7 +132,7 @@ export const useFetchNextDialog = () => {
},
});

return { data, loading };
return { data, loading, refetch };
};

export const useFetchManualDialog = () => {

+ 1
- 1
web/src/pages/chat/hooks.ts 파일 보기

@@ -429,7 +429,7 @@ export const useSendNextMessage = () => {
if (
answer.answer &&
(answer?.conversationId === conversationId ||
(!done && conversationId === ''))
((!done || (done && answer.audio_binary)) && conversationId === ''))
) {
addNewestAnswer(answer);
}

Loading…
취소
저장