...
This commit is contained in:
@@ -53,10 +53,11 @@ const deleteConversation = async (index) => {
|
|||||||
})
|
})
|
||||||
deletingConversationIndex.value = null
|
deletingConversationIndex.value = null
|
||||||
if (!error.value) {
|
if (!error.value) {
|
||||||
if (conversations.value[index].id === currentConversation.value.id) {
|
const deletingConversation = conversations.value[index]
|
||||||
createNewConversation()
|
|
||||||
}
|
|
||||||
conversations.value.splice(index, 1)
|
conversations.value.splice(index, 1)
|
||||||
|
if (deletingConversation.id === currentConversation.value.id) {
|
||||||
|
await navigateTo('/')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const loadMessage = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onActivated(async () => {
|
onMounted(async () => {
|
||||||
if (route.params.id) {
|
if (route.params.id) {
|
||||||
conversation.value.loadingMessages = true
|
conversation.value.loadingMessages = true
|
||||||
await loadConversation()
|
await loadConversation()
|
||||||
@@ -30,7 +30,13 @@ onActivated(async () => {
|
|||||||
conversation.value.loadingMessages = false
|
conversation.value.loadingMessages = false
|
||||||
} else {
|
} else {
|
||||||
conversation.value = getDefaultConversationData()
|
conversation.value = getDefaultConversationData()
|
||||||
|
watch(currentConversation, (val) => {
|
||||||
|
conversation.value = Object.assign({}, val)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
onActivated(async () => {
|
||||||
currentConversation.value = Object.assign({}, conversation.value)
|
currentConversation.value = Object.assign({}, conversation.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user