From f68b46699c06accd6b47510ae9d6d3ca4da29817 Mon Sep 17 00:00:00 2001 From: Fringg Date: Thu, 23 Apr 2026 03:56:07 +0300 Subject: [PATCH] fix: limited (traffic exhausted) subscription shows as expired MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Dashboard card: change date label from "Истекла" to "Активна до" for limited subscriptions (traffic exhausted but time remaining) - Dashboard button: change text from "Трафик исчерпан" (dead-end) to "Докупить трафик" (actionable) for limited status - Subscription page: CountdownTimer shows remaining time for limited subs instead of "Истекла" (was passing is_active=false) - PurchaseCTAButton: don't treat limited as expired — limited subs still have time, should show extend CTA not "buy new subscription" --- src/components/dashboard/SubscriptionCardExpired.tsx | 4 ++-- src/components/subscription/PurchaseCTAButton.tsx | 4 +++- src/locales/en.json | 3 ++- src/locales/ru.json | 3 ++- src/pages/Subscription.tsx | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/dashboard/SubscriptionCardExpired.tsx b/src/components/dashboard/SubscriptionCardExpired.tsx index 499ab92..361e727 100644 --- a/src/components/dashboard/SubscriptionCardExpired.tsx +++ b/src/components/dashboard/SubscriptionCardExpired.tsx @@ -228,7 +228,7 @@ export default function SubscriptionCardExpired({ >
- {t('dashboard.expired.expiredDate')} + {isLimited ? t('dashboard.expired.activeUntil') : t('dashboard.expired.expiredDate')}
{formattedDate} @@ -280,7 +280,7 @@ export default function SubscriptionCardExpired({ > - {t('subscription.trafficLimited')} + {t('subscription.buyTraffic')} ) : ( <> diff --git a/src/components/subscription/PurchaseCTAButton.tsx b/src/components/subscription/PurchaseCTAButton.tsx index 1fa7b0f..a4c816a 100644 --- a/src/components/subscription/PurchaseCTAButton.tsx +++ b/src/components/subscription/PurchaseCTAButton.tsx @@ -15,7 +15,9 @@ export default function PurchaseCTAButton({ }: PurchaseCTAButtonProps) { const { t } = useTranslation(); - const isExpired = !subscription || (!subscription.is_active && !subscription.is_trial); + const isExpired = + !subscription || + (!subscription.is_active && !subscription.is_trial && !subscription.is_limited); const isTrial = subscription?.is_trial; const isDaily = subscription?.is_daily; diff --git a/src/locales/en.json b/src/locales/en.json index 9ccd9d8..4038228 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -272,7 +272,8 @@ "tariffs": "Tariffs", "traffic": "Traffic", "devices": "Devices", - "expiredDate": "Expired" + "expiredDate": "Expired", + "activeUntil": "Active until" }, "suspended": { "title": "Subscription Suspended", diff --git a/src/locales/ru.json b/src/locales/ru.json index 00f19e4..21dd916 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -284,7 +284,8 @@ "tariffs": "Тарифы", "traffic": "Трафик", "devices": "Устройства", - "expiredDate": "Истекла" + "expiredDate": "Истекла", + "activeUntil": "Активна до" }, "suspended": { "title": "Подписка приостановлена", diff --git a/src/pages/Subscription.tsx b/src/pages/Subscription.tsx index 2be268d..5e2c5f3 100644 --- a/src/pages/Subscription.tsx +++ b/src/pages/Subscription.tsx @@ -957,7 +957,7 @@ export default function Subscription() {