From 60a342c2a9008ab5025a38c389a9636acec7b26a Mon Sep 17 00:00:00 2001 From: malmen237 Date: Mon, 8 Apr 2024 09:05:37 +0200 Subject: [PATCH] fix: removed test-function and added boolians to real-function --- src/components/landing-page/productions-list.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/components/landing-page/productions-list.tsx b/src/components/landing-page/productions-list.tsx index cd9414bf..c1d1d0b2 100644 --- a/src/components/landing-page/productions-list.tsx +++ b/src/components/landing-page/productions-list.tsx @@ -52,6 +52,7 @@ export const ProductionsList = () => { let aborted = false; if (reloadProductionList) { + setLoading(true); API.listProductions() .then((result) => { if (aborted) return; @@ -84,6 +85,7 @@ export const ProductionsList = () => { }) .catch(() => { // TODO handle error/retry + setLoading(false); }); } return () => { @@ -91,16 +93,6 @@ export const ProductionsList = () => { }; }, [dispatch, reloadProductionList]); - useEffect(() => { - const interval = window.setInterval(() => { - setLoading(!loading); - }, 5000); - - return () => { - window.clearInterval(interval); - }; - }, [loading]); - return ( {loading && }