Skip to content

Commit

Permalink
delete msg (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
swuecho authored Mar 27, 2023
1 parent 245fe93 commit 5304294
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions web/src/store/modules/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,21 +236,23 @@ export const useChatStore = defineStore('chat-store', {
if (!uuid) {
if (this.chat.length) {
const chatData = this.chat[0].data
if (chatData)
await deleteChatData(chatData[index])
const chat = chatData[index]
chatData.splice(index, 1)
this.recordState()
if (chat)
await deleteChatData(chat)
}
return
}

const chatIndex = this.chat.findIndex(item => item.uuid === uuid)
if (chatIndex !== -1) {
const chatData = this.chat[chatIndex].data
if (chatData)
await deleteChatData(chatData[index])
const chat = chatData[index]
chatData.splice(index, 1)
this.recordState()
if (chat)
await deleteChatData(chat)
}
},

Expand Down

0 comments on commit 5304294

Please sign in to comment.