feat: add indexDB

This commit is contained in:
Dogtiti 2024-08-26 21:20:07 +08:00
parent 4060e367ad
commit 492b55c893
1 changed files with 3 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import { createPersistStore } from "../utils/store";
import { collectModelsWithDefaultModel } from "../utils/model";
import { useAccessStore } from "./access";
import { isDalle3 } from "../utils";
import { clear } from "idb-keyval";
export type ChatMessage = RequestMessage & {
date: string;
@ -665,7 +666,8 @@ export const useChatStore = createPersistStore(
set(() => ({ sessions }));
},
clearAllData() {
async clearAllData() {
await clear();
localStorage.clear();
location.reload();
},