Skip to content

Conversation

@victorges
Copy link
Owner

Fix navigation throttling by removing navigate from useUser hook dependencies and adding a navigation guard.

The navigate function from react-router-dom was incorrectly included in the useEffect dependency array within useUser.ts. This caused the effect to re-run on every render, leading to a rapid navigation loop when combined with auth state changes that could trigger navigate('/login'). The browser detected this as throttling, preventing successful navigation to the clip page. The hasNavigated flag further ensures navigate('/login') is called only once per effect lifecycle.


Open in Cursor Open in Web

Introduce a flag to ensure navigation to login only occurs once, even if multiple auth errors are encountered.

Co-authored-by: victorgelias <victorgelias@gmail.com>
@cursor
Copy link

cursor bot commented Oct 20, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

cursoragent and others added 2 commits October 20, 2025 16:54
Co-authored-by: victorgelias <victorgelias@gmail.com>
Co-authored-by: victorgelias <victorgelias@gmail.com>
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.

3 participants