Skip to content

Commit

Permalink
fix: removed test-function and added boolians to real-function
Browse files Browse the repository at this point in the history
  • Loading branch information
malmen237 committed Apr 8, 2024
1 parent 6dda923 commit 60a342c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/components/landing-page/productions-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const ProductionsList = () => {
let aborted = false;

if (reloadProductionList) {
setLoading(true);
API.listProductions()
.then((result) => {
if (aborted) return;
Expand Down Expand Up @@ -84,23 +85,14 @@ export const ProductionsList = () => {
})
.catch(() => {
// TODO handle error/retry
setLoading(false);
});
}
return () => {
aborted = true;
};
}, [dispatch, reloadProductionList]);

useEffect(() => {
const interval = window.setInterval(() => {
setLoading(!loading);
}, 5000);

return () => {
window.clearInterval(interval);
};
}, [loading]);

return (
<Wrapper>
{loading && <LoaderDots />}
Expand Down

0 comments on commit 60a342c

Please sign in to comment.