From a00649584b5841b8c7ab6e98a71d22fa88e4be29 Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Wed, 13 May 2026 21:22:16 +0700 Subject: [PATCH] Put Telegram login timer first in button --- src/auth/telegram-bot-login.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/auth/telegram-bot-login.ts b/src/auth/telegram-bot-login.ts index 07b8b88..267b5c2 100644 --- a/src/auth/telegram-bot-login.ts +++ b/src/auth/telegram-bot-login.ts @@ -124,12 +124,12 @@ function formatRemaining(expiresAt: Date) { return `${minutes}:${rest}`; } -function loginReplyMarkup(token: string) { +function loginReplyMarkup(token: string, expiresAt: Date) { return { inline_keyboard: [ [ { - text: 'Войти', + text: `${formatRemaining(expiresAt)} Войти`, url: `${config.webAppUrl}?telegram_login=${encodeURIComponent(token)}`, }, ], @@ -138,7 +138,7 @@ function loginReplyMarkup(token: string) { } function loginMessageText(expiresAt: Date) { - return [formatRemaining(expiresAt), '', 'Войти в MapFlow'].join('\n'); + return 'Войти в MapFlow'; } async function sendLoginMessage( @@ -147,7 +147,7 @@ async function sendLoginMessage( token?: string, expiresAt?: Date, ) { - const replyMarkup = token && expiresAt ? loginReplyMarkup(token) : undefined; + const replyMarkup = token && expiresAt ? loginReplyMarkup(token, expiresAt) : undefined; return callTelegram('sendMessage', { chat_id: chatId,