Skip to content

Commit

Permalink
fix redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
francoborrelli committed Apr 15, 2024
1 parent 13b1407 commit a84cc8b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/Playlist/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ const PlaylistView: FC<{ container: RefObject<HTMLDivElement> }> = (props) => {
const playlist = playlists.find((playlist) => playlist.name.toLowerCase() === playlistId);

useEffect(() => {
if (!playlist) {
navigate('/404');
}

dispatch(playlistActions.resetOrder({ order: playlist?.defaultFilter || '' }));
}, [dispatch, playlist]);
}, [dispatch, playlist, navigate]);

if (!playlist) {
navigate('/404');
return null;
}

Expand Down

0 comments on commit a84cc8b

Please sign in to comment.