diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/meshbay-hub/src/meshbay_hub/static/search-page.js | 8 |
1 files changed, 6 insertions, 2 deletions
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 e36532f..fced022 100644 --- a/packages/meshbay-hub/src/meshbay_hub/static/search-page.js +++ b/packages/meshbay-hub/src/meshbay_hub/static/search-page.js @@ -190,6 +190,9 @@ function SearchPage({ token, username, userId, groups, onPlayQueue, userPrefs }) const [indexedGroups, setIndexedGroups] = useState(new Map()); const [progress, setProgress] = useState({ done: 0, total: 0, unreachable: [] }); const [fetching, setFetching] = useState(false); + // Bumped by the Files breadcrumb refresh button — re-runs the all-groups + // index fetch below, the only "cache" this page has. + const [refreshTick, setRefreshTick] = useState(0); const [query, setQuery] = useState(''); const [viewMode, setViewMode] = useState('files'); const [videoEntry, setVideoEntry] = useState(null); @@ -232,7 +235,7 @@ function SearchPage({ token, username, userId, groups, onPlayQueue, userPrefs }) })(); return () => { cancelled = true; }; - }, [groups, token]); + }, [groups, token, refreshTick]); // -- Connection management -- @@ -551,7 +554,8 @@ function SearchPage({ token, username, userId, groups, onPlayQueue, userPrefs }) onPreview=${onPreview} showGroup=${true} readOnly=${true} - getTransport=${getTransport} /> + getTransport=${getTransport} + onRefreshIndex=${() => setRefreshTick((n) => n + 1)} /> `} ${viewMode === 'videos' && hasResults && html` |