Skip to content

Commit

Permalink
feat: add indexDB
Browse files Browse the repository at this point in the history
  • Loading branch information
Dogtiti committed Aug 26, 2024
1 parent 4060e36 commit 492b55c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/store/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -665,7 +666,8 @@ export const useChatStore = createPersistStore(
set(() => ({ sessions }));
},

clearAllData() {
async clearAllData() {
await clear();
localStorage.clear();
location.reload();
},
Expand Down

0 comments on commit 492b55c

Please sign in to comment.