Join page names the owner of the link it was opened with, and tells a member when they are previewing their own page

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-13 07:54:29 -05:00
parent 6ca287042f
commit 6589930945
3 changed files with 15 additions and 9 deletions
+3 -2
View File
@@ -88,10 +88,11 @@
// sponsor line (the link opened most recently sets the sponsor; it locks at account creation)
let sponsorName = '';
fetch('/api/sponsor').then(r => r.json()).then(sp => {
const linkTok = (location.pathname.match(/^\/join\/([^/?#]+)/) || [])[1] || '';
fetch('/api/sponsor' + (linkTok ? '?ref=' + encodeURIComponent(linkTok) : '')).then(r => r.json()).then(sp => {
if (sp && sp.invited && sp.name) {
sponsorName = sp.name;
$('jnSponName').textContent = sp.name;
$('jnSponName').textContent = sp.name + (sp.own ? ' (this is your own invite page; visitors see your name here)' : '');
if (sp.avatarUrl) { $('jnSponImg').src = sp.avatarUrl; $('jnSponImg').hidden = false; }
$('jnSpon').hidden = false;
}