From 0ab62aa961092337984e87a78fef7f9e3574a07d Mon Sep 17 00:00:00 2001 From: Davide Scaini Date: Fri, 1 May 2026 22:07:01 +0200 Subject: [PATCH] fix(hub): activity card links to /u/{handle}/ when same origin to avoid hub loop --- site/src/pages/index.astro | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/site/src/pages/index.astro b/site/src/pages/index.astro index 56e305b..c7057de 100644 --- a/site/src/pages/index.astro +++ b/site/src/pages/index.astro @@ -113,8 +113,14 @@ const singleHandle = isSingleUser ? shards[0].handle : null; appsDiv.style.display = ''; greeting.textContent = `Ciao, ${user.display_name || user.handle}.`; cardsDiv.innerHTML = ''; - if (user.activity_access && activityUrl) - cardsDiv.appendChild(appCard('BincioActivity', 'Tracks, strade e numeri', activityUrl)); + if (user.activity_access && activityUrl) { + // If activityUrl is the same origin (dev --hub mode), go to the user page + // directly so we don't loop back to the hub root. + const activityHref = activityUrl === window.location.origin + ? `${activityUrl}/u/${user.handle}/` + : activityUrl; + cardsDiv.appendChild(appCard('BincioActivity', 'Tracks, strade e numeri', activityHref)); + } if (user.wiki_access && wikiUrl) cardsDiv.appendChild(appCard('BincioWiki', 'La memoria collettiva del gruppo', wikiUrl)); }