Skip to content

Commit

Permalink
fix : profile catche
Browse files Browse the repository at this point in the history
  • Loading branch information
Puskar-Roy committed Jul 30, 2024
1 parent f1cd046 commit 5439bed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/frontend/src/context/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ export const AuthContextProvider = ({ children }: AuthContextProviderProps) => {
}
}, []);


useEffect(() => {
if (state.user) {
localStorage.setItem("user", JSON.stringify(state.user));
} else {
localStorage.removeItem("user");
}
}, [state.user]);

console.log("Auth Context State : ", state);
return (
<AuthContext.Provider value={{ state, dispatch }}>
Expand Down

0 comments on commit 5439bed

Please sign in to comment.