Skip to content

Commit

Permalink
chore: scrollToBottom 改成 scrollToBottomIfAtBottom
Browse files Browse the repository at this point in the history
  • Loading branch information
shunyue1320 committed Mar 22, 2023
1 parent e02ab1f commit 1feb199
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/views/chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ useCopyCode()
const { isMobile } = useBasicLayout()
const { addChat, updateChat, updateChatSome, getChatByUuidAndIndex } = useChat()
const { scrollRef, scrollToBottom } = useScroll()
const { scrollRef, scrollToBottomIfAtBottom } = useScroll()
const { usingContext, toggleUsingContext } = useUsingContext()
const { uuid } = route.params as { uuid: string }
Expand Down Expand Up @@ -79,7 +79,7 @@ async function onConversation() {
requestOptions: { prompt: message, options: null },
},
)
scrollToBottom()
scrollToBottomIfAtBottom()
loading.value = true
prompt.value = ''
Expand All @@ -102,7 +102,7 @@ async function onConversation() {
requestOptions: { prompt: message, options: { ...options } },
},
)
scrollToBottom()
scrollToBottomIfAtBottom()
try {
let lastText = ''
Expand Down Expand Up @@ -142,7 +142,7 @@ async function onConversation() {
return fetchChatAPIOnce()
}
scrollToBottom()
scrollToBottomIfAtBottom()
}
catch (error) {
//
Expand All @@ -164,7 +164,7 @@ async function onConversation() {
loading: false,
},
)
scrollToBottom()
scrollToBottomIfAtBottom()
return
}
Expand Down Expand Up @@ -196,7 +196,7 @@ async function onConversation() {
requestOptions: { prompt: message, options: { ...options } },
},
)
scrollToBottom()
scrollToBottomIfAtBottom()
}
finally {
loading.value = false
Expand Down Expand Up @@ -451,7 +451,7 @@ const footerClass = computed(() => {
})
onMounted(() => {
scrollToBottom()
scrollToBottomIfAtBottom()
})
onUnmounted(() => {
Expand Down

0 comments on commit 1feb199

Please sign in to comment.