added intervals to call dispatch every second

parent b5b5a0ec
...@@ -13,7 +13,9 @@ const Albums: React.FunctionComponent = (): React.ReactElement => { ...@@ -13,7 +13,9 @@ const Albums: React.FunctionComponent = (): React.ReactElement => {
const navigate = useNavigate(); const navigate = useNavigate();
useEffect(() => { useEffect(() => {
setInterval(() => {
dispatch(getAlbumsByQueryParams(artist!)); dispatch(getAlbumsByQueryParams(artist!));
}, 1000);
}, [dispatch]); }, [dispatch]);
return ( return (
......
...@@ -11,7 +11,9 @@ const Tracks = () => { ...@@ -11,7 +11,9 @@ const Tracks = () => {
const album = params.get('album'); const album = params.get('album');
useEffect(() => { useEffect(() => {
setInterval(() => {
dispatch(getTracksByQuery(album!)); dispatch(getTracksByQuery(album!));
}, 1000);
}, [dispatch]); }, [dispatch]);
return ( return (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment