aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-08-24 23:09:13 +0200
committerChristophe Besson <cbesson@gmail.com>2026-08-24 23:09:13 +0200
commit25bf672719be2e47c15fc3659635b50a1540571d (patch)
treef7cb030eefc9e5fbb0683ce8a5debe15dac3aa52
parent5b41de6a972ef5f6ec93849fab337414733bdd57 (diff)
downloadmeshbay-25bf672719be2e47c15fc3659635b50a1540571d.tar.gz
fix(hub): refresh directory list after adding/removing a shared root
Folders (unlike files) only ever arrive over MNP as part of a full index_sync — the ongoing index_delta push has no `dirs` field at all (daemon.py never puts one there for incremental updates) — so a directory added or removed via the Electron-local add/remove flow never showed up in the Videos/Music root pickers until the whole page was reloaded. The merged Directories section made this easy to hit: add a shared folder, then immediately try to pick it as a root, in the same visit. Both actions now call the same onRefreshIndex a chat upload already uses to pick up its own effect on the index.
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/group-page.js1
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/group-settings.js13
2 files changed, 13 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 727bfc2..ab9dcc5 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/group-page.js
@@ -598,6 +598,7 @@ function GroupPage({ groupId, group, token, username, userId, userPrefs,
onVideoRoot=${(path) => setVideoRoot(path)}
audioRoot=${audioRoot}
onAudioRoot=${(path) => setAudioRoot(path)}
+ onRefreshIndex=${refreshIndex}
onLeft=${onLeft}
onPaired=${() => setOperatorPaired(true)} />
`}
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js b/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js
index 62665a8..858d672 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/group-settings.js
@@ -119,7 +119,7 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef,
tmdbConfig, onTmdbConfig, onTmdbEnabled,
musicbrainzConfig, onMusicbrainzConfig, onMusicbrainzEnabled,
entries, nodeDirs, videoRoot, onVideoRoot,
- audioRoot, onAudioRoot,
+ audioRoot, onAudioRoot, onRefreshIndex,
onPaired, onLeft }) {
const [members, setMembers] = useState([]);
const [adminId, setAdminId] = useState('');
@@ -982,6 +982,12 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef,
await platform.node.call('POST', '/api/reload');
setNodeMsg(t('node.root_removed'));
await loadNodeInfo();
+ // Folders (unlike files) only ever arrive via a full
+ // index_sync, never index_delta (daemon.py's ongoing
+ // push has no `dirs` field) — without this, the
+ // Videos/Music root pickers kept offering a folder
+ // that no longer existed until the page was reloaded.
+ if (onRefreshIndex) await onRefreshIndex();
} catch (err) { setNodeMsg(platform.bridgeMessage(err)); }
finally { setNodeBusy(false); }
}}>
@@ -1007,6 +1013,11 @@ function GroupSettingsPanel({ groupId, group, token, transportRef, gekRef,
await platform.watchIndexProgress(groupId, setNodeIndexProgress);
setNodeMsg(t('node.root_added'));
await loadNodeInfo();
+ // See the matching comment on root removal above — a new
+ // folder needs a full index_sync to show up anywhere that
+ // reads `nodeDirs` (the Videos/Music root pickers), not
+ // just in this section's own node-roots list.
+ if (onRefreshIndex) await onRefreshIndex();
} catch (err) { setNodeMsg(platform.bridgeMessage(err)); }
finally { setNodeBusy(false); }
}}>