Skip to content

Commit 51c419d

Browse files
committed
feat(Smart Question): In the conversation window, when there are many messages and a scroll bar appears, the scroll bar will automatically scroll to the bottom
1 parent b566e69 commit 51c419d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

frontend/src/views/chat/index.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ let scrollTopVal = 0
501501
let scrolling = false
502502
const scrollBottom = () => {
503503
if (scrolling) return
504-
if (!isTyping.value) {
504+
if (!isTyping.value && !getRecommendQuestionsLoading.value) {
505505
clearInterval(scrollTime)
506506
}
507507
chatListRef.value!.setScrollTop(innerRef.value!.clientHeight)
@@ -671,11 +671,14 @@ function quickAsk(question: string) {
671671
}
672672
673673
const chartAnswerRef = ref()
674-
674+
const getRecommendQuestionsLoading = ref(false)
675675
async function onChartAnswerFinish(id: number) {
676+
getRecommendQuestionsLoading.value = true
676677
loading.value = false
677678
isTyping.value = false
678-
getRecommendQuestions(id)
679+
getRecommendQuestions(id).finally(() => {
680+
getRecommendQuestionsLoading.value = false
681+
})
679682
}
680683
681684
function onChartAnswerError() {

0 commit comments

Comments
 (0)