Skip to content

Commit

Permalink
fix: reset history title on clear (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanXinOne authored Mar 10, 2023
1 parent 982cab6 commit 60b568a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/store/modules/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export const useChatStore = defineStore('chat-store', {
if (!uuid || uuid === 0) {
if (this.chat.length) {
this.chat[0].data = []
this.history[0].title = 'New Chat'
this.recordState()
}
return
Expand All @@ -173,6 +174,7 @@ export const useChatStore = defineStore('chat-store', {
const index = this.chat.findIndex(item => item.uuid === uuid)
if (index !== -1) {
this.chat[index].data = []
this.history[index].title = 'New Chat'
this.recordState()
}
},
Expand Down

0 comments on commit 60b568a

Please sign in to comment.