-
Notifications
You must be signed in to change notification settings - Fork 11.8k
fix: show personal credits even when user is on teams plan #27511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| }); | ||
| } | ||
| } else { | ||
| //if user is part of team, don't return any credits if teamId is not given |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caused the issue, that even if the user had personal credits we still returned null
| if (isLoading && teamId) return <BillingCreditsSkeleton />; | ||
| if (!creditsData) return null; | ||
|
|
||
| // For personal billing page: hide credits section if user is part of a team and has no personal credits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix is here, only hide when user is part of a team and has no personal credits
| onChange={(e) => setValue("quantity", Number(e.target.value))} | ||
| min={50} | ||
| addOnSuffix={<>{t("credits")}</>} | ||
| {/* Users who are part of a team cannot buy personal credits */} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure user can't buy more personal credits if they are part of a team
| <div className="text-subtle px-5 py-4 text-sm font-medium leading-tight"> | ||
| <ServerTrans | ||
| <div className="px-5 py-4 text-sm font-medium leading-tight text-subtle"> | ||
| <LearnMoreLink |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use existing LearnMoreLink that's already used in other places
eunjae-lee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 2 files
What does this PR do?
If a user buys credits on the free plan and later joins a team, their personal credits currently appear “lost” because they’re no longer shown in
/settings/billing.This PR ensures personal credits remain visible in billing even after joining a team. In this state, the option to buy credits is removed since only teams should be able to purchase credits. If the user is part of a team and has no personal credits, the credits section is hidden entirely.
As a follow-up, I’ll verify the backend logic and ensure we correctly fall back to personal credits when team credits run out.