From de4a694efd0d4fd1d68cd997e62a1e4fbc729a06 Mon Sep 17 00:00:00 2001 From: Egor Date: Sun, 18 Jan 2026 07:01:51 +0300 Subject: [PATCH] Update Subscription.tsx --- src/pages/Subscription.tsx | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/pages/Subscription.tsx b/src/pages/Subscription.tsx index 2d82d9d..5762afb 100644 --- a/src/pages/Subscription.tsx +++ b/src/pages/Subscription.tsx @@ -1095,6 +1095,13 @@ export default function Subscription() { {/* Tariff List - current tariff first */}
{[...tariffs] + // Hide Trial tariffs for users who already have trial subscription + .filter((tariff) => { + if (subscription?.is_trial && tariff.name.toLowerCase().includes('trial')) { + return false + } + return true + }) .sort((a, b) => { const aIsCurrent = a.is_current || a.id === subscription?.tariff_id const bIsCurrent = b.is_current || b.id === subscription?.tariff_id @@ -1787,7 +1794,15 @@ export default function Subscription() { {/* Step: Server Selection */} {currentStep === 'servers' && selectedPeriod?.servers.options && (
- {selectedPeriod.servers.options.map((server) => { + {selectedPeriod.servers.options + // Hide Trial server for users who already have trial subscription + .filter((server) => { + if (subscription?.is_trial && server.name.toLowerCase().includes('trial')) { + return false + } + return true + }) + .map((server) => { const hasExistingDiscount = !!(server.discount_percent && server.discount_percent > 0) const promoServer = applyPromoDiscount(server.price_kopeks, hasExistingDiscount) @@ -1822,7 +1837,7 @@ export default function Subscription() {
{server.name}
- {formatPrice(promoServer.price)} + {formatPrice(promoServer.price)}{t('subscription.perMonth')} {promoServer.original && ( {formatPrice(promoServer.original)} )} @@ -1860,8 +1875,15 @@ export default function Subscription() { +
-
- {formatPrice(selectedPeriod.devices.price_per_device_kopeks)} {t('subscription.perDevice')} +
+
+ {selectedPeriod.devices.min} {t('subscription.devicesFree')} +
+ {selectedPeriod.devices.max > selectedPeriod.devices.min && ( +
+ {formatPrice(selectedPeriod.devices.price_per_device_kopeks)} {t('subscription.perExtraDevice')} +
+ )}
)}