Skip to content

fix(referral): show correct status for pending referral reward#28715

Open
PanAchy wants to merge 2 commits into
anomalyco:devfrom
PanAchy:fix/referral-pending-copy
Open

fix(referral): show correct status for pending referral reward#28715
PanAchy wants to merge 2 commits into
anomalyco:devfrom
PanAchy:fix/referral-pending-copy

Conversation

@PanAchy
Copy link
Copy Markdown
Contributor

@PanAchy PanAchy commented May 21, 2026

Issue for this PR

Closes #28713

Type of change

  • Bug fix

What does this PR do?

The referral rewards UI showed "Subscribe to unlock" for two different situations:

  1. The referrer is not subscribed to Go — they need to subscribe (correct)
  2. The referrer is subscribed but their friend hasn't subscribed yet — "Subscribe to unlock" is wrong here, the referrer has already subscribed

This PR adds a separate i18n key for the pending-but-subscribed state, so the label correctly reads "Waiting for referral to subscribe" when the referrer is subscribed and the reward is pending.

Before:

function rewardActionKey(reward, hasActiveGo) {
  if (reward.status === "pending" || !hasActiveGo)
    return "workspace.referral.reward.action.subscribeUnlock";
  // ...
}

After:

function rewardActionKey(reward, hasActiveGo) {
  if (reward.status === "pending" && hasActiveGo)
    return "workspace.referral.reward.action.pendingFriendSubscription";
  if (!hasActiveGo) return "workspace.referral.reward.action.subscribeUnlock";
  // ...
}

The button remains disabled for pending rewards. Only the label changes.

Files changed:

  • packages/console/app/src/component/go-referral.tsx — updated rewardActionKey logic
  • packages/console/app/src/component/go-referral.reward-action.ts — new action key constant
  • packages/console/app/src/i18n/en.ts — new label string

How did you verify your code works?

  • Ran bun test in packages/console/app — 7 tests pass, 0 fail.
  • Ran bun typecheck in packages/console/app — no errors.
  • Confirmed the button disabled condition (reward.status !== "available" || !props.lite) is unchanged — pending rewards remain unclickable.
  • Confirmed the "Subscribe to unlock" label still appears correctly for non-subscribed users.

Screenshots / recordings

If this is a UI change, please include a screenshot or recording.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Referral reward shows "Subscribe to unlock" when friend hasn't subscribed yet

1 participant