Dogtiti 1 рік тому
батько
коміт
492b55c893
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      app/store/chat.ts

+ 3 - 1
app/store/chat.ts

@@ -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();
       },