mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-23 07:14:21 +00:00
✨ Store userData in localStorage
This commit is contained in:
parent
ad6b4c423e
commit
3854e75a23
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@ import {useInstance, useInstanceAxios} from "./InstanceContext";
|
|||
import {useNotNullContext} from "../hooks/useNotNullContext";
|
||||
import {Validity} from "@steffo/bluelib-react/dist/types";
|
||||
import {useFormState} from "@steffo/bluelib-react";
|
||||
import {useStorageState} from "../hooks/useStorageState";
|
||||
|
||||
|
||||
export interface UserData {
|
||||
|
@ -32,7 +33,7 @@ interface LoginContextProps {
|
|||
export function LoginContextProvider({children}: LoginContextProps): JSX.Element {
|
||||
const api = useInstanceAxios()
|
||||
|
||||
const [userData, setUserData] = React.useState<UserData | null>(null)
|
||||
const [userData, setUserData] = useStorageState<UserData | null>(localStorage, "userData", null)
|
||||
const [running, setRunning] = React.useState<boolean>(false)
|
||||
|
||||
const login = React.useCallback(
|
||||
|
|
Loading…
Reference in a new issue