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)})`, }); }