Stop offering "Connect Telegram" to members who are already connected

Janie linked successfully and the dashboard kept showing the Connect button,
so a working link looked like a failed one — and she had no way to tell which.

The Messages panel had no idea about link state: msg-inbox never reported it.
It now returns tgLinked (from tgbot.memberChat) on the response the panel
already fetches, so this costs no extra request. Linked members get a
confirmation telling them where their pings arrive and how to open the Mini
App, instead of a button asking them to do something already done.

Third variant today of the same failure: the interface not knowing a state it
could easily have known, and the member left guessing. The bot had it too —
telling an already-linked member their code had expired.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-08-29 07:05:26 -05:00
parent 8e7660a9a1
commit 962f0c8892
2 changed files with 15 additions and 1 deletions
+9
View File
@@ -307,6 +307,15 @@
try{
const foot=document.createElement('div');
foot.style.cssText='margin-top:12px;padding-top:10px;border-top:1px solid var(--line, #24425d)';
// Already connected? Say so and stop asking. Offering to connect someone
// who IS connected is how a working link looks broken.
if(data&&data.tgLinked){
foot.innerHTML='<div class="micro" style="color:var(--teal)">✈️ <b>Telegram connected.</b> '
+'Payout pings, team messages and join alerts arrive in your chat with the bot. '
+'Open the bot and tap ☰ for your dashboard inside Telegram.</div>';
el.appendChild(foot);
return;
}
foot.innerHTML='<button id="tgLinkBtn" class="btn btn-secondary btn-sm">✈️ Connect Telegram — payout pings + team chat</button><span class="micro" id="tgLinkNote" style="margin-left:8px"></span>';
el.appendChild(foot);
const tb=document.getElementById('tgLinkBtn');