mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 06:44:21 +00:00
✨ Store userData in localStorage
This commit is contained in:
parent
53d5d6d47b
commit
61b63944c5
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