aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
diff options
context:
space:
mode:
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.js6
1 files changed, 5 insertions, 1 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 747cb74..e762fc8 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
@@ -374,7 +374,11 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs,
transport.onMusicbrainzEnabled = (enabled) =>
setMusicbrainzConfig((prev) => ({ ...(prev || {}), enabled }));
transport.onRootsChanged = (msg) => {
- if (msg.roots) {
+ // `msg.roots &&` would accept `[]`, and an empty array is truthy —
+ // so a node that could not describe its roots would blank the
+ // operator's table on an op that actually succeeded. A group always
+ // has at least one root, so nothing legitimate is dropped here.
+ if (Array.isArray(msg.roots) && msg.roots.length) {
setNodeRoots(msg.roots);
}
};