Skip to content

Commit 786660a

Browse files
committed
fix
1 parent 045eb95 commit 786660a

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

  • apps/sim/app/workspace/[workspaceId]/home/components/credits-chip

apps/sim/app/workspace/[workspaceId]/home/components/credits-chip/credits-chip.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)