From a84cc8bf13140a069034754f5c316453597520e5 Mon Sep 17 00:00:00 2001 From: Franco Borrelli Date: Mon, 15 Apr 2024 13:42:16 -0300 Subject: [PATCH] fix redirection --- src/pages/Playlist/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pages/Playlist/index.tsx b/src/pages/Playlist/index.tsx index 67bc29c..f57060e 100644 --- a/src/pages/Playlist/index.tsx +++ b/src/pages/Playlist/index.tsx @@ -21,11 +21,14 @@ const PlaylistView: FC<{ container: RefObject }> = (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; }