Conversation
WalkthroughThe pull request adds conditional guards to authentication event handlers in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Closes #171
📝 Description
The issue was the "Signed in!" toast message appears repeatedly whenever the browser tab is minimized and re-focused.
This was caused by the Supabase SIGNED_IN auth event firing again during session refresh, which happens automatically when the tab regains focus.
🔧 Changes Made
The PR adds a guard so the toast only triggers when the authentication state actually changes.
case "SIGNED_IN":
if (!isAuthenticated) {
setIsAuthenticated(true);
toast.success("Signed in!");
}
break;
case "SIGNED_OUT":
if (isAuthenticated) {
setIsAuthenticated(false);
setRepoData(null);
toast.success("Signed out!");
}
break;
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.