Skip to content

fix: prevent Share Profile button flash before settings load#328

Merged
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
jaygaikar-09:fix/share-profile-flash
May 19, 2026
Merged

fix: prevent Share Profile button flash before settings load#328
Priyanshu-byte-coder merged 1 commit into
Priyanshu-byte-coder:mainfrom
jaygaikar-09:fix/share-profile-flash

Conversation

@jaygaikar-09
Copy link
Copy Markdown
Contributor

Summary

Fixes the issue where the "Share Profile" button briefly flashed on dashboard load for users with private profiles because the UI rendered before /api/user/settings finished loading.

Closes #194


Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup

Changes Made

  • Replaced the settings-based visibility check with a tri-state isPublic flag:
    • null → loading
    • true → public profile
    • false → private profile or fetch failure
  • Updated rendering logic to only show the button when:
    isPublic === true && session?.githubLogin

@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@jaygaikar-09 is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Thanks for your first PR on DevTrack! 🎉

A maintainer will review it within 48 hours. While you wait:

  • Make sure CI is passing (type-check + lint)
  • Double-check the PR description is filled out and the issue is linked
  • Feel free to ask questions in Discussions if you need help

Copy link
Copy Markdown
Owner

@Priyanshu-byte-coder Priyanshu-byte-coder left a comment

Choose a reason for hiding this comment

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

Clean fix. Changing to isPublic === true strict check ensures the button stays hidden until settings are confirmed loaded, not just until the first API call starts. Error/failure paths now default to false instead of leaving null indefinitely. The flash is eliminated.

@Priyanshu-byte-coder Priyanshu-byte-coder merged commit e2cbf39 into Priyanshu-byte-coder:main May 19, 2026
7 checks passed
@Priyanshu-byte-coder Priyanshu-byte-coder added gssoc:approved GSSoC: PR approved for scoring level:beginner GSSoC: Beginner difficulty (20 pts) gssoc26 GSSoC 2026 contribution type:bug GSSoC type bonus: bug fix labels May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved GSSoC: PR approved for scoring gssoc26 GSSoC 2026 contribution level:beginner GSSoC: Beginner difficulty (20 pts) type:bug GSSoC type bonus: bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] DashboardHeader 'Share Profile' link shown before is_public setting loads

2 participants