mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-09 01:08:41 +08:00
feat: migrate state from v1 to v2
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { create } from "zustand";
|
||||
import { persist } from "zustand/middleware";
|
||||
import { StoreKey } from "../constant";
|
||||
|
||||
export interface AccessControlStore {
|
||||
accessCode: string;
|
||||
@@ -14,8 +15,6 @@ export interface AccessControlStore {
|
||||
fetch: () => void;
|
||||
}
|
||||
|
||||
export const ACCESS_KEY = "access-control";
|
||||
|
||||
let fetchState = 0; // 0 not fetch, 1 fetching, 2 done
|
||||
|
||||
export const useAccessStore = create<AccessControlStore>()(
|
||||
@@ -62,7 +61,7 @@ export const useAccessStore = create<AccessControlStore>()(
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: ACCESS_KEY,
|
||||
name: StoreKey.Access,
|
||||
version: 1,
|
||||
},
|
||||
),
|
||||
|
Reference in New Issue
Block a user