diff --git a/app/api/routes/auth.py b/app/api/routes/auth.py index b879ce4..115c17c 100644 --- a/app/api/routes/auth.py +++ b/app/api/routes/auth.py @@ -99,6 +99,9 @@ async def s_api_v1_auth_twa(request): ) ))).scalars().first() + known_user.last_use = datetime.now() + request.ctx.db_session.commit() + return response.json({ 'user': known_user.json_format(), 'connected_wallet': ton_connection.json_format() if ton_connection else None, diff --git a/app/bot/routers/home.py b/app/bot/routers/home.py index 78215df..f325621 100644 --- a/app/bot/routers/home.py +++ b/app/bot/routers/home.py @@ -15,7 +15,7 @@ async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs): chat_wrap, user.translated('home_menu').format( wallet_address=( Address(wallet_connection.wallet_address).to_string(1, 1, 1) - if wallet_connection else user.translated('noWalletConnected') + if wallet_connection else user.translated('p_walletNotConnected') ), name=user.front_format(plain_text=True), ), keyboard=get_inline_keyboard([ @@ -26,7 +26,7 @@ async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs): [{ 'text': user.translated('disconnectWallet_button'), 'callback_data': 'disconnectWallet' - }] + }] if wallet_connection else [] ]), **kwargs ) diff --git a/app/client_bot/routers/home.py b/app/client_bot/routers/home.py index 6e89034..a3fe36d 100644 --- a/app/client_bot/routers/home.py +++ b/app/client_bot/routers/home.py @@ -15,7 +15,7 @@ main_router = Router() async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs): return await tg_process_template( chat_wrap, user.translated('home_menu').format( - wallet_address=Address(wallet_connection.wallet_address).to_string(1, 1, 1), + wallet_address=Address(wallet_connection.wallet_address).to_string(1, 1, 1) if wallet_connection else user.translated('p_walletNotConnected'), name=user.front_format(plain_text=True), ), keyboard=get_inline_keyboard([ [{ @@ -25,7 +25,7 @@ async def send_home_menu(chat_wrap, user, wallet_connection, **kwargs): [{ 'text': user.translated('disconnectWallet_button'), 'callback_data': 'disconnectWallet' - }] + }] if wallet_connection else [] ]), **kwargs ) @@ -70,8 +70,8 @@ async def t_home_menu(__msg, **extra): WalletConnection.invalidated == False ).first() - if not wallet_connection: - return await send_connect_wallets_list(db_session, chat_wrap, user, message_id=message_id) + # if not wallet_connection: + # return await send_connect_wallets_list(db_session, chat_wrap, user, message_id=message_id) args = [] if isinstance(__msg, types.Message): diff --git a/app/core/_config.py b/app/core/_config.py index 48528cc..80ecf40 100644 --- a/app/core/_config.py +++ b/app/core/_config.py @@ -11,8 +11,6 @@ UPLOADS_DIR = os.getenv('UPLOADS_DIR', '/app/data') if not os.path.exists(UPLOADS_DIR): os.makedirs(UPLOADS_DIR) -CONFIG_FILE = os.getenv('CONFIG_FILE') or f"{UPLOADS_DIR}/../config/config" - TELEGRAM_API_KEY = os.environ.get('TELEGRAM_API_KEY') assert TELEGRAM_API_KEY, "Telegram API_KEY required" CLIENT_TELEGRAM_API_KEY = os.environ.get('CLIENT_TELEGRAM_API_KEY') @@ -34,7 +32,7 @@ _now_str = datetime.now().strftime("%Y-%m-%d_%H-%M-%S") LOG_FILEPATH = f"{LOG_DIR}/{_now_str}.log" WEB_APP_URLS = { - 'uploadContent': f"https://music-ui.letsw.app/uploadContent" + 'uploadContent': f"https://web2-client.vercel.app/uploadContent" } ALLOWED_CONTENT_TYPES = [