Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove useEffect #82

Closed
wants to merge 1 commit into from
Closed

Conversation

hbrooks
Copy link
Member

@hbrooks hbrooks commented Jan 22, 2024

Summary:

This PR removes a useEffect hook from the HomePage component, which was responsible for user redirection and data fetching based on session status.

Key points:

  • Removed useEffect hook from HomePage component in home.tsx.
  • This hook was handling user redirection and data fetching based on session status.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes required


Generated with ❤️ by ellipsis.dev

Comment on lines +17 to +24
// useEffect(() => {
// if (!isSessionLoading && !session) {
// push('/auth');
// }
// if (!isSessionLoading && session) {
// getUserFromSupabase(session, supabase, setUser);
// }
// }, [isSessionLoading, session]);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The useEffect hook here is crucial for redirecting the user to the '/auth' page if there is no session and for fetching the user data from Supabase if there is a session. By commenting out this hook, these functionalities are lost. This could lead to unauthorized access to the home page and the user data not being fetched. I suggest uncommenting this block of code.

@hbrooks hbrooks closed this Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant