added intervals to call dispatch every second

parent b5b5a0ec
......@@ -13,7 +13,9 @@ const Albums: React.FunctionComponent = (): React.ReactElement => {
const navigate = useNavigate();
useEffect(() => {
dispatch(getAlbumsByQueryParams(artist!));
setInterval(() => {
dispatch(getAlbumsByQueryParams(artist!));
}, 1000);
}, [dispatch]);
return (
......
......@@ -11,7 +11,9 @@ const Tracks = () => {
const album = params.get('album');
useEffect(() => {
dispatch(getTracksByQuery(album!));
setInterval(() => {
dispatch(getTracksByQuery(album!));
}, 1000);
}, [dispatch]);
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