aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/app.js
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-08-28 09:33:02 +0200
committerChristophe Besson <cbesson@gmail.com>2026-08-28 09:33:02 +0200
commit2dd221b2a3172feecc44eb20b07d0ac7c925d378 (patch)
tree707afe03768482cadb58b90c4bb24880229e5a24 /packages/meshbay-hub/src/meshbay_hub/static/app.js
parentc170b9cffd2b8fb4b7ef919ee62c28d2daaa8711 (diff)
downloadmeshbay-2dd221b2a3172feecc44eb20b07d0ac7c925d378.tar.gz
fix(hub): Explore page says nothing about public groups when they're off
When the hub has public groups disabled, /explore showed an empty "Public Groups" screen with a search box and a Create button that do nothing. It now renders a single line — "This hub does not have public groups." — and the server already returns an empty directory regardless. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018gKJ85aZyvEwarXMFzFEwi
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/app.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/app.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/app.js b/packages/meshbay-hub/src/meshbay_hub/static/app.js
index a380033..9164a4d 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/app.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/app.js
@@ -629,7 +629,7 @@ function HomePage({ groups, notifications, onMarkRead, onPurge }) {
// ── Explore Page ─────────────────────────────────────────────────────────────
-function ExplorePage({ token, myGroupIds }) {
+function ExplorePage({ token, myGroupIds, allowPublicGroups = true }) {
const [groups, setGroups] = useState([]);
const [loading, setLoading] = useState(true);
const [search, setSearch] = useState('');
@@ -671,6 +671,13 @@ function ExplorePage({ token, myGroupIds }) {
const isMember = (gid) => myGroupIds && myGroupIds.includes(gid);
+ // The hub can switch public groups off instance-wide (the server already
+ // returns nothing here). Say so plainly rather than showing an empty
+ // "Public groups" screen — nothing on this page has anything to do.
+ if (!allowPublicGroups) {
+ return html`<div><p class="page-message">${t('explore.disabled')}</p></div>`;
+ }
+
return html`
<div>
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:16px">
@@ -3270,7 +3277,8 @@ function App() {
page = html`<${SearchPage} />`;
} else if (route === '/explore') {
page = html`<${ExplorePage} token=${user.token}
- myGroupIds=${groups.map(g => g.id)} />`;
+ myGroupIds=${groups.map(g => g.id)}
+ allowPublicGroups=${allowPublicGroups} />`;
} else if (route === '/create-group') {
page = html`<${CreateGroupPage} token=${user.token} username=${user.username}
allowPublicGroups=${allowPublicGroups}