fix(webapp): clarify expiring subscription countdown

This commit is contained in:
3252a8
2026-06-02 14:33:28 +03:00
parent 966a18045d
commit 21f9ed803d
3 changed files with 21 additions and 4 deletions
+17 -4
View File
@@ -29,6 +29,7 @@
} from "../../lib/webapp/traffic.js";
const SUBSCRIPTION_EXPIRY_WARNING_MS = 72 * 60 * 60 * 1000;
const SUBSCRIPTION_EXPIRING_SOON_MS = 24 * 60 * 60 * 1000;
export let appSettings = {};
export let brand = {};
@@ -151,8 +152,22 @@
);
$: subscriptionEndDateText = subscriptionEndDateLabel(subscription);
$: subscriptionEndCountdown = formatSubscriptionCountdown(subscriptionRemainingMs);
$: subscriptionEndCountdownLabel = t(
"wa_subscription_remaining_countdown",
{ countdown: subscriptionEndCountdown },
`осталось: ${subscriptionEndCountdown}`
);
$: subscriptionExpiringSoon = Boolean(
subscription?.active &&
subscriptionEndMs &&
subscriptionRemainingMs > 0 &&
subscriptionRemainingMs < SUBSCRIPTION_EXPIRING_SOON_MS
);
$: subscriptionTermDisplayText = subscriptionExpiringSoon
? t("wa_subscription_expiring_soon", {}, "Скоро закончится!")
: activeSubscriptionTermLabel(subscription);
$: subscriptionEndDisplayText = subscriptionExpiryWarning
? `${subscriptionEndDateText || subscription.end_date_text} · ${subscriptionEndCountdown}`
? `${subscriptionEndDateText || subscription.end_date_text} \u00b7 ${subscriptionEndCountdownLabel}`
: subscriptionEndDateText;
$: statusCardClass = [
"status-card",
@@ -203,9 +218,7 @@
<CheckCircle2 class="sub-status-icon" size={23} />
<div class="sub-status-main">
<h2>
{trafficMode ? t("wa_home_access_active") : t("wa_home_subscription_active")} | {activeSubscriptionTermLabel(
subscription
)}
{trafficMode ? t("wa_home_access_active") : t("wa_home_subscription_active")} | {subscriptionTermDisplayText}
</h2>
<div
class:sub-status-details-with-tariff={hasActiveTariffSubscription &&
+2
View File
@@ -731,6 +731,7 @@
"wa_auth_legal_agreement": "user agreement",
"wa_home_subscription_active": "Subscription active",
"wa_home_access_active": "Access active",
"wa_subscription_expiring_soon": "Ending soon!",
"wa_sub_term_forever": "Forever",
"wa_sub_term_value_unit": "{value} {unit}",
"wa_sub_term_day_one": "day",
@@ -744,6 +745,7 @@
"wa_sub_term_year_many": "years",
"wa_home_subscription_inactive": "Subscription inactive",
"wa_until_date": "until {date}",
"wa_subscription_remaining_countdown": "left: {countdown}",
"wa_home_traffic_used": "Traffic used",
"wa_premium_traffic_title": "Premium servers",
"wa_premium_reset_monthly": "Separate monthly limit",
+2
View File
@@ -731,6 +731,7 @@
"wa_auth_legal_agreement": "пользовательским соглашением",
"wa_home_subscription_active": "Подписка активна",
"wa_home_access_active": "Доступ активен",
"wa_subscription_expiring_soon": "Скоро закончится!",
"wa_sub_term_forever": "Навсегда",
"wa_sub_term_value_unit": "{value} {unit}",
"wa_sub_term_day_one": "день",
@@ -744,6 +745,7 @@
"wa_sub_term_year_many": "лет",
"wa_home_subscription_inactive": "Подписка не активна",
"wa_until_date": "до {date}",
"wa_subscription_remaining_countdown": "осталось: {countdown}",
"wa_home_traffic_used": "Использовано трафика",
"wa_premium_traffic_title": "Premium-серверы",
"wa_premium_reset_monthly": "Отдельный лимит на месяц",