Skip to content

Commit 42651a9

Browse files
committed
fix: quick start chat
1 parent 7378438 commit 42651a9

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

frontend/src/views/chat/index.vue

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ const createNewChat = async () => {
412412
chatCreatorRef.value?.showDs()
413413
}
414414
415-
function getChatList() {
415+
function getChatList(callback?: () => void) {
416416
loading.value = true
417417
chatApi
418418
.list()
@@ -421,6 +421,9 @@ function getChatList() {
421421
})
422422
.finally(() => {
423423
loading.value = false
424+
if (callback && typeof callback === 'function') {
425+
callback()
426+
}
424427
})
425428
}
426429
@@ -754,10 +757,6 @@ function stop(func?: (...p: any[]) => void, ...param: any[]) {
754757
}
755758
}
756759
757-
onMounted(() => {
758-
getChatList()
759-
})
760-
761760
defineExpose({
762761
getHistoryList,
763762
toAssistantHistory,
@@ -767,7 +766,7 @@ defineExpose({
767766
768767
const hiddenChatCreatorRef = ref()
769768
770-
onMounted(() => {
769+
function jumpCreatChat() {
771770
if (props.startChatDsId) {
772771
const _id = props.startChatDsId
773772
nextTick(() => {
@@ -776,6 +775,10 @@ onMounted(() => {
776775
const newUrl = window.location.hash.replace(/\?.*$/, '')
777776
history.replaceState({}, '', newUrl)
778777
}
778+
}
779+
780+
onMounted(() => {
781+
getChatList(jumpCreatChat)
779782
})
780783
</script>
781784

0 commit comments

Comments
 (0)