chore: Refactor deleteChatHistory method to deleteAllChatHistory
This commit is contained in:
@@ -121,6 +121,14 @@ export class PageAssitDatabase {
|
||||
this.db.remove(id)
|
||||
}
|
||||
|
||||
async deleteAllChatHistory() {
|
||||
const chatHistories = await this.getChatHistories()
|
||||
chatHistories.forEach((history) => {
|
||||
this.db.remove(history.id)
|
||||
})
|
||||
this.db.set({ chatHistories: [] })
|
||||
}
|
||||
|
||||
async deleteMessage(history_id: string) {
|
||||
await this.db.remove(history_id)
|
||||
}
|
||||
@@ -456,4 +464,4 @@ export const importPrompts = async (prompts: Prompts) => {
|
||||
for (const prompt of prompts) {
|
||||
await db.addPrompt(prompt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user