This commit is contained in:
Rafi
2023-04-03 23:37:50 +08:00
parent 836df995d0
commit 16c9b0e230
2 changed files with 11 additions and 4 deletions

View File

@@ -53,10 +53,11 @@ const deleteConversation = async (index) => {
})
deletingConversationIndex.value = null
if (!error.value) {
if (conversations.value[index].id === currentConversation.value.id) {
createNewConversation()
}
const deletingConversation = conversations.value[index]
conversations.value.splice(index, 1)
if (deletingConversation.id === currentConversation.value.id) {
await navigateTo('/')
}
}
}