Исправил много чего в фронте
This commit is contained in:
@@ -129,15 +129,15 @@ async def _show_subscriptions_view(
|
||||
index = max(0, min(index, len(subs) - 1))
|
||||
sub = subs[index]
|
||||
|
||||
plan_title = _plan_human_title(sub.get("plan"))
|
||||
expiry_raw = sub.get("expiry_date")
|
||||
plan_title = _plan_human_title(sub.get("plan_name"))
|
||||
end_raw = sub.get("end_date") # Исправил
|
||||
date_str = "—"
|
||||
days_left = None
|
||||
status_emoji = "🟢"
|
||||
|
||||
if expiry_raw:
|
||||
if end_raw:
|
||||
try:
|
||||
dt = datetime.fromisoformat(expiry_raw)
|
||||
dt = datetime.fromisoformat(end_raw)
|
||||
date_str = dt.strftime("%d.%m.%Y")
|
||||
now = datetime.now(dt.tzinfo) if dt.tzinfo else datetime.now()
|
||||
days_left = (dt.date() - now.date()).days
|
||||
@@ -272,19 +272,22 @@ async def cb_sub_cfg(callback: types.CallbackQuery):
|
||||
await callback.answer()
|
||||
return
|
||||
|
||||
if not isinstance(detail, str) or not detail:
|
||||
uri = None
|
||||
if isinstance(detail, str):
|
||||
uri = detail.strip()
|
||||
elif isinstance(detail, list) and detail:
|
||||
uri = str(detail[0]).strip()
|
||||
|
||||
if not uri:
|
||||
await callback.message.answer(
|
||||
"Что-то пошло не так при выдаче конфига."
|
||||
)
|
||||
await callback.answer()
|
||||
return
|
||||
|
||||
escaped = escape_markdown_v2(detail)
|
||||
text = f"Твой конфиг:\n```{escaped}```"
|
||||
|
||||
await callback.message.answer(
|
||||
text,
|
||||
parse_mode=ParseMode.MARKDOWN_V2,
|
||||
f"Твой конфиг:\n<code>{uri}</code>",
|
||||
parse_mode=ParseMode.HTML,
|
||||
)
|
||||
await callback.answer()
|
||||
|
||||
@@ -310,7 +313,7 @@ async def cb_sub_renew(callback: types.CallbackQuery):
|
||||
await callback.answer()
|
||||
return
|
||||
|
||||
plan_id = target.get("plan")
|
||||
plan_id = target.get("plan_name")
|
||||
if not plan_id:
|
||||
await callback.message.answer("Не удалось определить тариф для продления.")
|
||||
await callback.answer()
|
||||
|
||||
Reference in New Issue
Block a user