Updated the UserProvider.jsx
This commit is contained in:
parent
0b93f024ec
commit
a7eec6de05
@ -6,7 +6,9 @@ export const UserContext = createContext({});
|
||||
export const UserProvider = ({children}) => {
|
||||
const [user, setUser] = useState(null);
|
||||
|
||||
const updateUser = async () => jsonRequest("/user/@me").then((res) => setUser(res));
|
||||
const updateUser = async () => jsonRequest("/user/@me")
|
||||
.catch(() => setUser(null))
|
||||
.then((res) => setUser(res));
|
||||
|
||||
useEffect(() => {
|
||||
updateUser();
|
||||
|
Loading…
x
Reference in New Issue
Block a user