feat: add VITE_REDUX_STORAGE environment variable and update storage configuration

This commit is contained in:
2026-03-21 03:37:30 +08:00
parent 3735e902b0
commit 945d9dd2eb
4 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ export default function HeroLayout() {
</header>
{/* Main Content Area */}
<main className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8 flex-grow">
<main className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8 grow">
<div className="px-4 py-6 sm:px-0">
<Outlet />
</div>
+3 -2
View File
@@ -10,10 +10,11 @@ import {
PURGE,
REGISTER,
} from "redux-persist"
import storage from "redux-persist/lib/storage/session" // use session storage
// import storage from "redux-persist/lib/storage" // use local storage
import createWebStorage from "redux-persist/es/storage/createWebStorage"
import authReducer from "./auth-slice"
const storage = createWebStorage(import.meta.env.VITE_REDUX_STORAGE ?? "local")
const persistConfig = {
key: "root",
storage,
+1 -1
View File
@@ -1,6 +1,6 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
// todo add env properties here
readonly VITE_REDUX_STORAGE: "local" | "session"
}
interface ImportMeta {