fix(mtproto-ui): restore status fetch, trim promo footer

ReferenceError fixed by awaiting /api/mtproto/status before using snap. Footer: GitHub-only; dropped Boosty/Ozon/Telegram. Removed advertiseHint from install JSON (hint remains on status).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Андрей Бобырев
2026-05-15 03:32:45 +03:00
parent ecf754c7da
commit 6c2698c106
4 changed files with 5 additions and 11 deletions

View File

@@ -366,6 +366,7 @@ async function refreshMtprotoPanel() {
mtprotoBanner.textContent = "";
}
try {
const s = await api("/api/mtproto/status");
if (mtprotoLogsTailEl) mtprotoLogsTailEl.textContent = typeof s.logsTail === "string" ? s.logsTail : "";
const parts = [];
@@ -423,7 +424,6 @@ async function refreshMtprotoPanel() {
const lines = [];
if (typeof j.secretHex === "string") lines.push(`Секрет (сохраните): ${j.secretHex}`);
if (typeof j.tgLink === "string" && j.tgLink) lines.push(`Ссылка: ${j.tgLink}`);
if (typeof j.advertiseHint === "string" && j.advertiseHint) lines.push(j.advertiseHint);
if (mtprotoBanner) {
mtprotoBanner.textContent = lines.join("\n");
mtprotoBanner.classList.remove("hidden");
@@ -481,6 +481,7 @@ async function refreshMtprotoPanel() {
mtprotoActionsEl.appendChild(row);
} catch (e) {
if (mtprotoLogsTailEl) mtprotoLogsTailEl.textContent = "";
const err = document.createElement("p");
err.className = "muted warp-muted err";
err.textContent = String(e.message || e);