File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff 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-
761760defineExpose ({
762761 getHistoryList ,
763762 toAssistantHistory ,
@@ -767,7 +766,7 @@ defineExpose({
767766
768767const 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
You can’t perform that action at this time.
0 commit comments