diff options
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/group-page.js')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/group-page.js | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js index fec685b..c59d097 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js @@ -350,15 +350,18 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs, tokenCustomized: !!ack.tmdb_token_customized, language: ack.tmdb_language || '', }); - // The plural form when the node speaks it, the old scalars when it - // does not — an MNP 1.0 node sends only the latter, and reading its - // missing `video_directories` as "nothing configured" would empty a - // working Videos tab. - setAppDirectories({ - video: ack.video_directories || [], - music: ack.music_directories || [], - photo: ack.photo_directories || [], - }); + // Every `<app>_directories` the ack carries, keyed by the app's own + // name — read off the ack rather than from a list of app names held + // here, so an application the node knows about is one this page already + // handles. Three names were hardcoded until 2026-09-10 and `helloworld` + // was not among them, so the app that exists to prove a new one needs + // no special-casing had its directories dropped on arrival. The live + // path below (`onAppDirectories`) was always generic; this was the half + // that was not. + setAppDirectories(Object.fromEntries( + Object.keys(ack) + .filter((k) => k.endsWith('_directories')) + .map((k) => [k.slice(0, -'_directories'.length), ack[k] || []]))); setChatDirectory(ack.chat_directory || ''); setChatLinkPreview(ack.chat_link_preview !== false); setMusicbrainzConfig({ @@ -677,9 +680,11 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs, setEntries, setNodeDirs, setNodeRoots, applyIndex, isNodeAdmin, operatorPaired, attachRoot, attachDir, userId, setError, onPreview, onRefreshIndex: refreshIndex, onActivity: touchActivity, - // Plural everywhere: Videos and Music read a list now, and Photos always - // did. The scalar `videoRoot`/`audioRoot` shapes survive only on the wire, - // for a node that speaks MNP 1.0 — nothing in the client carries them. + // Plural everywhere, and built from the registry rather than a list of app + // names kept here: Videos and Music read a list, Photos always did, and an + // application added to `APPS` gets its own entry without this file + // changing. The scalar `videoRoot`/`audioRoot` shapes are gone from the + // wire too, so nothing anywhere carries them. ...perAppDirectories, tmdbConfig, musicbrainzConfig, onPlayQueue, |