summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/files-app.js11
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/search-page.js1
2 files changed, 7 insertions, 5 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/files-app.js b/packages/meshbay-hub/src/meshbay_hub/static/files-app.js
index d2f0727..ab7e254 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/files-app.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/files-app.js
@@ -27,7 +27,7 @@ function FilesPanel({
groupId, transportRef, gekRef, status,
entries, nodeDirs, nodeRoots, setEntries, setNodeDirs, setNodeRoots, applyIndex,
isNodeAdmin, operatorPaired, mayUpload, userId, setError, onPreview,
- showGroup, readOnly, getTransport, onRefreshIndex,
+ showGroup, readOnly, getTransport, onRefreshIndex, showRefresh,
}) {
const [selecting, setSelecting] = useState(false);
const [selected, setSelected] = useState(() => new Set());
@@ -37,9 +37,10 @@ function FilesPanel({
const [currentPath, setCurrentPath] = useState('');
const [refreshing, setRefreshing] = useState(false);
- // Force a re-fetch of the group index from the node — the client's file
- // list is a view over a cached copy, and there is no other way to pull a
- // fresh one on demand.
+ // Only the cross-group Search page shows this (`showRefresh`): it has no
+ // live node connection pushing index deltas, so its file list really is
+ // a one-shot cached fetch. In a real group the node streams every change
+ // as it happens, so a manual re-fetch would just duplicate that.
const doRefresh = useCallback(async () => {
if (refreshing || !onRefreshIndex) return;
setRefreshing(true);
@@ -339,7 +340,7 @@ function FilesPanel({
</div>
<div class="breadcrumbs">
- ${onRefreshIndex && html`
+ ${showRefresh && onRefreshIndex && html`
<button class="crumb crumb-refresh ${refreshing ? 'spinning' : ''}"
onClick=${doRefresh} disabled=${refreshing}
title=${t('group.refresh_index')}>
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/search-page.js b/packages/meshbay-hub/src/meshbay_hub/static/search-page.js
index fced022..f144ef0 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/search-page.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/search-page.js
@@ -555,6 +555,7 @@ function SearchPage({ token, username, userId, groups, onPlayQueue, userPrefs })
showGroup=${true}
readOnly=${true}
getTransport=${getTransport}
+ showRefresh=${true}
onRefreshIndex=${() => setRefreshTick((n) => n + 1)} />
`}