File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ export default defineComponent({
15
15
type: String ,
16
16
},
17
17
},
18
- setup(props ) {
18
+ emits: [' send' ],
19
+ setup(props , { emit }) {
19
20
const { id } = useId ()
20
21
const { isDesktop, modKey } = useDevice ()
21
22
const chatId = computed (() => props .chatId || id ())
@@ -218,6 +219,8 @@ export default defineComponent({
218
219
}
219
220
220
221
isWaiting .value = false
222
+
223
+ emit (' send' )
221
224
}
222
225
223
226
const examplePrompts = ref ([
Original file line number Diff line number Diff line change @@ -8,27 +8,22 @@ export default defineComponent({
8
8
const { isMounted } = useVue ()
9
9
const chatIdFromRoute = computed (() => router .currentRoute .value .params .id as string )
10
10
const chatId = computed (() => chatIdFromRoute .value || id ())
11
- const { chat } = useChat (chatId )
12
- const { pushRoute } = useSoftNavigation ()
13
11
14
- watch (chat , () => {
15
- if (chat .value && ! chatIdFromRoute .value ) {
16
- pushRoute ({
17
- path: ` /assistant/conversations/${chatId .value } ` ,
18
- })
19
- }
20
- })
12
+ const redirect = () => {
13
+ router .push ({ path: ` /assistant/conversations/${chatId .value } ` })
14
+ }
21
15
22
16
return {
23
17
chatId ,
24
18
isMounted ,
19
+ redirect ,
25
20
}
26
21
},
27
22
})
28
23
</script >
29
24
30
25
<template >
31
26
<article class =" flex flex-col flex-grow" >
32
- <Assistant v-if =" isMounted" :chat-id =" chatId" />
27
+ <Assistant v-if =" isMounted" :chat-id =" chatId" @send = " redirect " />
33
28
</article >
34
29
</template >
You can’t perform that action at this time.
0 commit comments