Leaderboard hardcodes currentUserId = user-1 instead of reading from session - #301
Conversation
|
@nanaabdul1172 is attempting to deploy a commit to the Threadflow Team on Vercel. A member of the Team first needs to authorize it. |
|
@nanaabdul1172 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe leaderboard now derives the current user id from the authenticated session and passes it to user-specific widgets. The VS Code settings file is rewritten as an empty JSON object. ChangesLeaderboard session identity
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Benjtalkshow
left a comment
There was a problem hiding this comment.
Clean fix for #271, CI is green and tsc + lint pass locally. One small
thing: please revert .vscode/settings.json out of this PR — the only
change there is {} becoming {\n}, which is editor-induced churn and
doesn't belong in the diff. Also attach a screenshot of the leaderboard
while signed in (showing your own row highlighted) so I can verify the
visual result. Once those are done, ready to merge.
closes #271
implemented changes:
Added import { authClient } from "@/lib/auth-client" to the imports.
Replaced the hardcoded const currentUserId = "user-1" (and its stale comment) with:
const { data: session } = authClient.useSession();
const currentUserId = session?.user?.id;
currentUserId is now string | undefined — undefined when signed out, which both LeaderboardTable and UserRankSidebar already handle gracefully.
Summary by CodeRabbit