chore: interval text for one time & github action quick fix
This commit is contained in:
5
.github/workflows/vite-build.yml
vendored
5
.github/workflows/vite-build.yml
vendored
@@ -1,11 +1,6 @@
|
||||
name: Vite Build Check
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- staging
|
||||
- dev
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user