aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2022-11-25 17:29:10 -0600
committerJP Dillingham <jp@dillingham.me>2022-11-25 17:29:10 -0600
commit46fdeeec1db71068cf2562070a3802f812cef6e4 (patch)
treef0eee3681706ac71081bcb02febfc893c7e1fd91 /src
parente34571b4c8579ea3fdb4d68ee6926868f456515f (diff)
downloadslskd-46fdeeec1db71068cf2562070a3802f812cef6e4.tar.gz
refresh shares when state changes
Diffstat (limited to 'src')
-rw-r--r--src/web/src/components/System/Shares/index.js9
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 {