From 3e0ac818f206246b55131c85bff3919cd76430b8 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Thu, 18 Sep 2025 19:41:05 +0300 Subject: [PATCH] =?UTF-8?q?bot(priceButtons):=20=D0=BF=D1=80=D0=BE=D0=B4?= =?UTF-8?q?=D0=BB=D0=B8=D1=82=D1=8C/=D0=B4=D0=BE=D1=81=D1=82=D1=83=D0=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/bot/src/bot/conversations/subscription.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/bot/src/bot/conversations/subscription.ts b/apps/bot/src/bot/conversations/subscription.ts index b825c6e..71fc0df 100644 --- a/apps/bot/src/bot/conversations/subscription.ts +++ b/apps/bot/src/bot/conversations/subscription.ts @@ -40,7 +40,11 @@ export async function subscription(conversation: Conversation, const prices = sift(subscriptionPrices); // строим клавиатуру с указанием даты окончания после покупки - const keyboard = buildPricesKeyboard(prices, currentSubscription?.expiresAt); + const keyboard = buildPricesKeyboard( + prices, + currentSubscription?.expiresAt, + hasActiveSubscription, + ); // сообщение с выбором плана const messageWithPrices = await ctx.reply( @@ -123,6 +127,7 @@ function addDays(date: Date, days: number) { function buildPricesKeyboard( prices: GQL.SubscriptionPriceFieldsFragment[], currentExpiresAt?: string, + hasActiveSubscription = false, ) { const keyboard = new InlineKeyboard(); const baseTime = currentExpiresAt @@ -138,7 +143,7 @@ function buildPricesKeyboard( keyboard.row({ callback_data: price.period, pay: true, - text: `Продлить до ${targetDateRu} (${formatMoney(price.amount)})`, + text: `${hasActiveSubscription ? 'Продлить' : 'Доступ'} до ${targetDateRu} (${formatMoney(price.amount)})`, }); }