chore: interval text for one time & github action quick fix

This commit is contained in:
Charlie Lamb
2026-01-16 18:39:14 +00:00
parent 18d053df10
commit 58f44eec5e
2 changed files with 23 additions and 17 deletions

View File

@@ -1,11 +1,6 @@
name: Vite Build Check
on:
push:
branches:
- main
- staging
- dev
pull_request:
jobs:

View File

@@ -82,19 +82,30 @@ export function EditPlanSection() {
},
});
const oldIntervalText = originalInterval
? formatInterval({
interval: originalInterval,
intervalCount: originalIntervalCount,
})
: null;
const getIntervalText = (
interval: typeof originalInterval,
intervalCount: number,
hasPriceItem: boolean,
) => {
if (interval) {
return formatInterval({ interval, intervalCount });
}
// Only show "one-time" if there's a price item with no interval
// Otherwise it's variable/usage-based
return hasPriceItem ? "one-time" : null;
};
const newIntervalText = currentInterval
? formatInterval({
interval: currentInterval,
intervalCount: currentIntervalCount,
})
: (oldIntervalText ?? "per month");
const oldIntervalText = getIntervalText(
originalInterval,
originalIntervalCount,
!!originalPriceItem,
);
const newIntervalText = getIntervalText(
currentInterval,
currentIntervalCount,
!!currentPriceItem,
);
return {
oldPrice: formatPrice(originalPrice),