File tree Expand file tree Collapse file tree
apps/sim/app/workspace/[workspaceId]/home/components/credits-chip Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ function CreditsChipInner() {
3131 const router = useRouter ( )
3232 const queryClient = useQueryClient ( )
3333 const { workspaceId } = useParams < { workspaceId : string } > ( )
34- const { data : memberCredits } = useMyMemberCredits ( workspaceId )
34+ const { data : memberCredits , isLoading : memberLoading } = useMyMemberCredits ( workspaceId )
3535
3636 const upgradeHref = `/workspace/${ workspaceId } /upgrade`
3737
@@ -57,6 +57,13 @@ function CreditsChipInner() {
5757 </ Chip >
5858 )
5959
60+ // Wait for the per-member cap result before rendering: until it resolves,
61+ // `limitDollars` is null and a capped member would briefly see the larger
62+ // pooled number. Disabled (no workspace) → not loading, so non-org users are
63+ // unaffected; cached after the first load (30s staleTime), so it's a one-time
64+ // wait, not a per-navigation one.
65+ if ( memberLoading ) return null
66+
6067 /**
6168 * Pooled/plan remaining (dollars): unused plan allowance plus any purchased
6269 * credit balance. Null when the plan-based chip wouldn't show on its own (data
You can’t perform that action at this time.
0 commit comments