From 58f44eec5e155a18f15f4ac81894c6cbb89d3003 Mon Sep 17 00:00:00 2001 From: Charlie Lamb Date: Fri, 16 Jan 2026 18:39:14 +0000 Subject: [PATCH] chore: interval text for one time & github action quick fix --- .github/workflows/vite-build.yml | 5 --- .../components/EditPlanSection.tsx | 35 ++++++++++++------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/vite-build.yml b/.github/workflows/vite-build.yml index 9aaf84b6e..fc194d98d 100644 --- a/.github/workflows/vite-build.yml +++ b/.github/workflows/vite-build.yml @@ -1,11 +1,6 @@ name: Vite Build Check on: - push: - branches: - - main - - staging - - dev pull_request: jobs: diff --git a/vite/src/components/forms/update-subscription-v2/components/EditPlanSection.tsx b/vite/src/components/forms/update-subscription-v2/components/EditPlanSection.tsx index a842e8895..f724640aa 100644 --- a/vite/src/components/forms/update-subscription-v2/components/EditPlanSection.tsx +++ b/vite/src/components/forms/update-subscription-v2/components/EditPlanSection.tsx @@ -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),