Skip to content

Commit f191d32

Browse files
brendanhsentryGPT-5.4
andcommitted
fix(billing): Handle nullable bucket skips
Keep the billing null-bucket fallback type-safe so frontend type checks pass when unsupported plan categories are skipped. Co-Authored-By: GPT-5.4 <noreply@example.com> Made-with: Cursor
1 parent 2feed9c commit f191d32

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

static/gsApp/views/amCheckout/steps/reserveAdditionalVolume.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ export function ReserveAdditionalVolume({
4343
)
4444
.some(
4545
({category, reserved}) =>
46-
getBucket({
46+
(getBucket({
4747
buckets: activePlan.planCategories[category],
4848
events: reserved ?? 0,
49-
})?.price > 0
49+
})?.price ?? 0) > 0
5050
)
5151
);
5252
const [reserved, setReserved] = useState<Partial<Record<DataCategory, number>>>(

static/gsApp/views/subscriptionPage/utils.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export function calculateCategorySpend(
3434
const priceBucket = getBucket({events: categoryInfo.reserved, buckets: slots});
3535
if (!priceBucket) {
3636
return {
37-
reservedUse: 0,
37+
prepaidSpent: 0,
38+
onDemandSpent: 0,
3839
unitPrice: 0,
3940
onDemandUnitPrice: 0,
4041
prepaidPrice: 0,

0 commit comments

Comments
 (0)