diff --git a/frontend/src/views/chat/RecommendQuestion.vue b/frontend/src/views/chat/RecommendQuestion.vue index a192b0a43..5acb9012c 100644 --- a/frontend/src/views/chat/RecommendQuestion.vue +++ b/frontend/src/views/chat/RecommendQuestion.vue @@ -21,7 +21,7 @@ const props = withDefaults( } ) -const emits = defineEmits(['clickQuestion', 'update:currentChat', 'stop']) +const emits = defineEmits(['clickQuestion', 'update:currentChat', 'stop', 'loadingOver']) const loading = ref(false) @@ -134,6 +134,7 @@ async function getRecommendQuestions() { } } finally { loading.value = false + emits('loadingOver') } } diff --git a/frontend/src/views/chat/index.vue b/frontend/src/views/chat/index.vue index afb99444e..60accc1c5 100644 --- a/frontend/src/views/chat/index.vue +++ b/frontend/src/views/chat/index.vue @@ -195,6 +195,7 @@ :first-chat="message.first_chat" @click-question="quickAsk" @stop="onChatStop" + @loadingOver="loadingOver" /> @@ -676,9 +678,11 @@ async function onChartAnswerFinish(id: number) { getRecommendQuestionsLoading.value = true loading.value = false isTyping.value = false - getRecommendQuestions(id).finally(() => { - getRecommendQuestionsLoading.value = false - }) + getRecommendQuestions(id) +} + +const loadingOver = () => { + getRecommendQuestionsLoading.value = false } function onChartAnswerError() {