Mini App: tapping your OWN invite link previews the prospect view

Linked members were always routed to their dashboard, so a sponsor could
never see their angle page through their own t.me link. Now ref == own id ->
/join/<id>?src=miniapp-preview (+angle); a teammate's link still opens the
dashboard. links command notes the preview trick.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-08-23 07:16:00 -05:00
parent 826f779bc0
commit 29ec8e82a1
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -39,7 +39,13 @@
method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ initData: tg.initData })
}).then(function (r) { return r.json(); }).then(function (d) {
if (d && d.ok && d.linked) { location.replace('/my/' + d.id); return; }
if (d && d.ok && d.linked) {
// A member tapping their OWN invite link wants to preview what their
// prospects see — show the squeeze page (tagged so stats stay clean).
// Tapping a teammate's link still lands on their own dashboard.
if (ref && String(d.id) === ref) { location.replace('/join/' + ref + '?src=miniapp-preview' + (angle ? '&v=' + angle : '')); return; }
location.replace('/my/' + d.id); return;
}
if (d && d.ok) {
if (ref) { location.replace('/join/' + ref + '?src=miniapp' + (angle ? '&v=' + angle : '')); return; }
show('st-unlinked'); return;