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 | 13 |
1 files changed, 10 insertions, 3 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 4de33b9..060fd6e 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js @@ -173,11 +173,18 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs, const [searchListed, setSearchListed] = useState(true); // MusicBrainz on/off (per-group) — docs/musicbay.md §3.2. const [musicbrainzConfig, setMusicbrainzConfig] = useState(null); - const onPlayQueue = useCallback((tracks, startIndex) => { - setVideoEntry(null); + // `op` rides through to the shell — 'replace', 'next' or 'append' + // (docs/playlists.md §9.2). It has to be named here: a wrapper that takes + // two arguments and forwards two silently turns every "add to queue" in this + // group into a "play", and nothing about that reads as wrong at the call + // site or here. + const onPlayQueue = useCallback((tracks, startIndex, op) => { + // Only a replace changes what is on screen; enqueueing something does not + // close whatever the reader was already looking at. + if (!op || op === 'replace') setVideoEntry(null); if (parentOnPlayQueue) { const annotated = tracks.map(tr => tr.groupId ? tr : { ...tr, groupId }); - parentOnPlayQueue(annotated, startIndex, { transportRef, gekRef, groupId }); + parentOnPlayQueue(annotated, startIndex, { transportRef, gekRef, groupId }, op); } }, [parentOnPlayQueue, groupId]); // Paired ≠ operator account. `is_node_admin` says the hub account owning this |