From 46fdeeec1db71068cf2562070a3802f812cef6e4 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Fri, 25 Nov 2022 17:29:10 -0600 Subject: refresh shares when state changes --- src/web/src/components/System/Shares/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/web') 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 { -- cgit v1.2.3