mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 20:39:01 +08:00
fix: frontend handle sometimes server not generate the wrong follow up data struct (#7916)
This commit is contained in:
parent
0cfcc97e9d
commit
7fdd964379
@ -372,11 +372,16 @@ export const useChat = (
|
|||||||
handleUpdateChatList(newChatList)
|
handleUpdateChatList(newChatList)
|
||||||
}
|
}
|
||||||
if (config?.suggested_questions_after_answer?.enabled && !hasStopResponded.current && onGetSuggestedQuestions) {
|
if (config?.suggested_questions_after_answer?.enabled && !hasStopResponded.current && onGetSuggestedQuestions) {
|
||||||
const { data }: any = await onGetSuggestedQuestions(
|
try {
|
||||||
responseItem.id,
|
const { data }: any = await onGetSuggestedQuestions(
|
||||||
newAbortController => suggestedQuestionsAbortControllerRef.current = newAbortController,
|
responseItem.id,
|
||||||
)
|
newAbortController => suggestedQuestionsAbortControllerRef.current = newAbortController,
|
||||||
setSuggestQuestions(data)
|
)
|
||||||
|
setSuggestQuestions(data)
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
setSuggestQuestions([])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onFile(file) {
|
onFile(file) {
|
||||||
|
@ -248,11 +248,16 @@ export const useChat = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (config?.suggested_questions_after_answer?.enabled && !hasStopResponded.current && onGetSuggestedQuestions) {
|
if (config?.suggested_questions_after_answer?.enabled && !hasStopResponded.current && onGetSuggestedQuestions) {
|
||||||
const { data }: any = await onGetSuggestedQuestions(
|
try {
|
||||||
responseItem.id,
|
const { data }: any = await onGetSuggestedQuestions(
|
||||||
newAbortController => suggestedQuestionsAbortControllerRef.current = newAbortController,
|
responseItem.id,
|
||||||
)
|
newAbortController => suggestedQuestionsAbortControllerRef.current = newAbortController,
|
||||||
setSuggestQuestions(data)
|
)
|
||||||
|
setSuggestQuestions(data)
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
setSuggestQuestions([])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onMessageEnd: (messageEnd) => {
|
onMessageEnd: (messageEnd) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user