Skip to content

Commit

Permalink
Remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwroge committed Oct 24, 2024
1 parent 0b5e11a commit 7a80dae
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions frontend/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,13 @@ import {setCredentials} from './redux/authSlice';
function HuuApp() {
const [session] = useSessionMutation();
const dispatch = useAppDispatch();
// signin to current session if it exists, otherwise fail silently
// React.useEffect(() => {
// session()
// .unwrap()
// .then(res => {
// const {token, user} = res;
// dispatch(setCredentials({user, token}));
// });
// }, []);

React.useEffect(() => {
const fetchSession = async () => {
try {
const res = await session().unwrap();
const {token, user} = res || {};

// Check if token exists before dispatching
if (token && user) {
dispatch(setCredentials({user, token}));
} else {
Expand Down

0 comments on commit 7a80dae

Please sign in to comment.