diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-11-25 17:40:39 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-11-25 17:40:39 -0600 |
| commit | fd72cac19e6beaa2ec6377b791f9b3d0bbd88d94 (patch) | |
| tree | 8b7b2bbaeffb1b90e310a8e2a7e913bf2592127a /src | |
| parent | 46fdeeec1db71068cf2562070a3802f812cef6e4 (diff) | |
| download | slskd-fd72cac19e6beaa2ec6377b791f9b3d0bbd88d94.tar.gz | |
suppress loader
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/src/components/System/Shares/index.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/web/src/components/System/Shares/index.js b/src/web/src/components/System/Shares/index.js index c4282986..3d5b1858 100644 --- a/src/web/src/components/System/Shares/index.js +++ b/src/web/src/components/System/Shares/index.js @@ -30,16 +30,19 @@ const Index = ({ state = {} } = {}) => { }, []); useEffect(() => { - getAll(); + getAll({ quiet: true }); if (!scanning) { - setTimeout(() => getAll(), 1000); + // the state change out of scanning can fire before + // shares are updated, which leaves them stale. wait a second + // and fetch again. + setTimeout(() => getAll({ quiet: true }), 1000); } }, [scanning, scanPending]); - const getAll = async () => { + const getAll = async ({ quiet } = { quiet: false }) => { try { - setLoading(true); + if (!quiet) setLoading(true); const sharesByHost = await sharesLib.getAll(); const flattened = Object.entries(sharesByHost).reduce((acc, [host, shares]) => { |
