diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-11-25 17:29:10 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2022-11-25 17:29:10 -0600 |
| commit | 46fdeeec1db71068cf2562070a3802f812cef6e4 (patch) | |
| tree | f0eee3681706ac71081bcb02febfc893c7e1fd91 /src/web | |
| parent | e34571b4c8579ea3fdb4d68ee6926868f456515f (diff) | |
| download | slskd-46fdeeec1db71068cf2562070a3802f812cef6e4.tar.gz | |
refresh shares when state changes
Diffstat (limited to 'src/web')
| -rw-r--r-- | src/web/src/components/System/Shares/index.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/web/src/components/System/Shares/index.js b/src/web/src/components/System/Shares/index.js index f4f9ac94..c4282986 100644 --- a/src/web/src/components/System/Shares/index.js +++ b/src/web/src/components/System/Shares/index.js @@ -24,17 +24,18 @@ const Index = ({ state = {} } = {}) => { const [modal, setModal] = useState(false); const { scanning, scanProgress, scanPending, directories, files } = state; - const scanned = !scanning; useEffect(() => { getAll(); }, []); useEffect(() => { - if (scanned) { - getAll(); + getAll(); + + if (!scanning) { + setTimeout(() => getAll(), 1000); } - }, [scanned]); + }, [scanning, scanPending]); const getAll = async () => { try { |
