Summary
On the Invite Friends dashboard, the referral link starts as an empty string until /api/referrals/code returns. The Copy button is enabled during that loading window, so a quick click can copy an empty string and show the user a successful copy state even though no invite link was copied.
Steps to reproduce
- Open
/dashboard/referrals on a slow connection or while /api/referrals/code is delayed.
- Click Copy before the referral link input is populated.
Expected
Copying should be disabled until the referral link is loaded, or the action should show a clear loading error instead of copying an empty string.
Actual
The Copy button can run with an empty referralLink value.
Proposed fix
Disable the Copy button while no referral link is loaded and guard the handler against empty-link copies.
Summary
On the Invite Friends dashboard, the referral link starts as an empty string until
/api/referrals/codereturns. The Copy button is enabled during that loading window, so a quick click can copy an empty string and show the user a successful copy state even though no invite link was copied.Steps to reproduce
/dashboard/referralson a slow connection or while/api/referrals/codeis delayed.Expected
Copying should be disabled until the referral link is loaded, or the action should show a clear loading error instead of copying an empty string.
Actual
The Copy button can run with an empty
referralLinkvalue.Proposed fix
Disable the Copy button while no referral link is loaded and guard the handler against empty-link copies.