mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-07-23 22:34:44 +00:00
feat: 优化打字机模式显示新内容的逻辑 (#394)
* 添加为打字机模式优化的滚动至底部函数 * feat: 优化打字机模式始终显示最新内容的逻辑 * feat: 内容输出结束时也根据滚动条位置判断是否滚动至底部
This commit is contained in:
@@ -24,7 +24,7 @@ const chatStore = useChatStore()
|
||||
useCopyCode()
|
||||
const { isMobile } = useBasicLayout()
|
||||
const { addChat, updateChat, updateChatSome, getChatByUuidAndIndex } = useChat()
|
||||
const { scrollRef, scrollToBottom } = useScroll()
|
||||
const { scrollRef, scrollToBottom, scrollToBottomIfAtBottom } = useScroll()
|
||||
|
||||
const { uuid } = route.params as { uuid: string }
|
||||
|
||||
@@ -113,14 +113,14 @@ async function onConversation() {
|
||||
requestOptions: { prompt: message, options: { ...options } },
|
||||
},
|
||||
)
|
||||
scrollToBottom()
|
||||
scrollToBottomIfAtBottom()
|
||||
}
|
||||
catch (error) {
|
||||
//
|
||||
}
|
||||
},
|
||||
})
|
||||
scrollToBottom()
|
||||
scrollToBottomIfAtBottom()
|
||||
}
|
||||
catch (error: any) {
|
||||
const errorMessage = error?.message ?? t('common.wrong')
|
||||
|
Reference in New Issue
Block a user