[FA-11] Fix build errors, try to fix cache miss on node build
This commit is contained in:
@@ -14,12 +14,11 @@ const AuthContext = createContext<AuthContextValue | undefined>(undefined)
|
||||
|
||||
export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
const [user, setUser] = useState<User | null>(null)
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
const [isLoading, setIsLoading] = useState(!!userManager)
|
||||
const callbackHandledRef = useRef(false)
|
||||
|
||||
useEffect(() => {
|
||||
if (!userManager) {
|
||||
setIsLoading(false)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -121,6 +120,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
|
||||
return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-refresh/only-export-components
|
||||
export function useAuth() {
|
||||
const context = useContext(AuthContext)
|
||||
if (!context) {
|
||||
|
||||
Reference in New Issue
Block a user