Fix the bug of conversation title

This commit is contained in:
Rafi
2023-04-01 21:54:15 +08:00
parent f20a3562f3
commit 8ff914582a
3 changed files with 8 additions and 8 deletions

View File

@@ -11,7 +11,8 @@ const conversation = ref(getDefaultConversationData())
const loadConversation = async () => {
const { data, error } = await useAuthFetch('/api/chat/conversations/' + route.params.id)
if (!error.value) {
conversation.value = data.value
conversation.value = Object.assign(conversation.value, data.value)
console.log(conversation.value)
}
}
@@ -24,7 +25,6 @@ const loadMessage = async () => {
onActivated(async () => {
console.log('activated')
console.log(conversation.value)
if (route.params.id) {
conversation.value.loadingMessages = true
await loadConversation()
@@ -33,9 +33,12 @@ onActivated(async () => {
} else {
conversation.value = getDefaultConversationData()
}
console.log(conversation.value)
currentConversation.value = Object.assign({}, conversation.value)
})
watchEffect(() => {
console.log('conversation.value', conversation.value)
})
</script>
<template>