mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	feat: add indexDB
This commit is contained in:
		@@ -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();
 | 
			
		||||
      },
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user