Refactored store

This commit is contained in:
cracklesparkle
2024-06-25 15:56:00 +09:00
parent 85f97e9e0e
commit 18fb120777
15 changed files with 205 additions and 113 deletions

View File

@ -8,7 +8,7 @@ import MainLayout from "./layouts/MainLayout"
import SignIn from "./pages/auth/SignIn"
import ApiTest from "./pages/ApiTest"
import SignUp from "./pages/auth/SignUp"
import { useAuthStore } from "./store/auth"
import { initAuth, useAuthStore } from "./store/auth"
import { useEffect, useState } from "react"
import { CircularProgress } from "@mui/material"
@ -17,7 +17,7 @@ function App() {
const [isLoading, setIsLoading] = useState(true)
useEffect(() => {
auth.initializeAuth()
initAuth()
}, [])
// Once auth is there, set loading to false and render the app