From 29ec8e82a1139d081f610b990424da3dca6342a7 Mon Sep 17 00:00:00 2001 From: martbost Date: Sun, 23 Aug 2026 07:16:00 -0500 Subject: [PATCH] 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/?src=miniapp-preview (+angle); a teammate's link still opens the dashboard. links command notes the preview trick. Co-Authored-By: Claude Fable 5 --- public/app.js | 8 +++++++- tgbot.js | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/public/app.js b/public/app.js index 4624e4d..4fdc0f9 100644 --- a/public/app.js +++ b/public/app.js @@ -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; diff --git a/tgbot.js b/tgbot.js index b121b65..77ad2cb 100644 --- a/tgbot.js +++ b/tgbot.js @@ -230,7 +230,7 @@ function linksText(id) { const ma = miniAppInvite(id); return `🔗 Your links, #${id} (each one credits YOU):\n\n` + `Moving invite link (routes to whoever needs help next in your leg):\n${b}/join/${id}\n\n` + - (ma ? `⚡ Telegram-native invite — opens instantly INSIDE Telegram (best for sharing in groups and DMs here):\n${ma}\n\n` : '') + + (ma ? `⚡ Telegram-native invite — opens instantly INSIDE Telegram (best for sharing in groups and DMs here):\n${ma}\n(Tap it yourself to preview exactly what your prospects will see.)\n\n` : '') + `Angle-matched links — pick the hook that fits your person:\n` + `💸 Pocket Change: ${b}/join/${id}?v=pocket\n` + `📱 Your Phone: ${b}/join/${id}?v=phone\n` +