diff --git a/frontend/src/components/Filterbar.tsx b/frontend/src/components/Filterbar.tsx index 95f3c8f9..24bc0999 100644 --- a/frontend/src/components/Filterbar.tsx +++ b/frontend/src/components/Filterbar.tsx @@ -60,6 +60,7 @@ const Filterbar = ({ } if (currentViewStyle === ViewStylesEnum.Table) { + // eslint-disable-next-line react-hooks/set-state-in-effect setShowHidden(true); } else { setShowHidden(false); diff --git a/frontend/src/components/VideoPlayer.tsx b/frontend/src/components/VideoPlayer.tsx index f0ef79d6..b4660dac 100644 --- a/frontend/src/components/VideoPlayer.tsx +++ b/frontend/src/components/VideoPlayer.tsx @@ -146,6 +146,7 @@ const VideoPlayer = ({ } if (setSeekToTimestamp) setSeekToTimestamp(undefined); window.scroll(0, 0); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [seekToTimestamp]); const [searchParams] = useSearchParams(); @@ -389,6 +390,7 @@ const VideoPlayer = ({ } else if (!theaterModePressed) { setTheaterModeKeyPressed(false); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [theaterModePressed, isTheaterMode, theaterModeKeyPressed]); useEffect(() => { @@ -401,6 +403,7 @@ const VideoPlayer = ({ infoDialog('Normal mode'); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [escapePressed, isTheaterMode]); return ( diff --git a/frontend/src/pages/Playlist.tsx b/frontend/src/pages/Playlist.tsx index 910b3205..45f2bdee 100644 --- a/frontend/src/pages/Playlist.tsx +++ b/frontend/src/pages/Playlist.tsx @@ -108,7 +108,6 @@ const Playlist = () => { } setRefresh(false); })(); - // eslint-disable-next-line react-hooks/exhaustive-deps }, [ playlistId, userConfig.hide_watched_playlist, diff --git a/frontend/src/pages/Search.tsx b/frontend/src/pages/Search.tsx index 6af56508..47fcce9a 100644 --- a/frontend/src/pages/Search.tsx +++ b/frontend/src/pages/Search.tsx @@ -65,6 +65,13 @@ const Search = () => { const gridView = isGridView ? `boxed-${gridItems}` : ''; const gridViewGrid = isGridView ? `grid-${gridItems}` : ''; + const fetchResults = async (searchQuery: string) => { + const searchResults = await loadSearch(searchQuery); + + setSearchResults(searchResults); + setRefresh(false); + }; + useEffect(() => { const handler = setTimeout(() => { setDebouncedSearchTerm(searchTerm); @@ -77,19 +84,13 @@ const Search = () => { useEffect(() => { if (debouncedSearchTerm.trim() !== '') { + // eslint-disable-next-line react-hooks/set-state-in-effect fetchResults(debouncedSearchTerm); } else { setSearchResults(EmptySearchResponse); } }, [debouncedSearchTerm, refresh, videoId]); - const fetchResults = async (searchQuery: string) => { - const searchResults = await loadSearch(searchQuery); - - setSearchResults(searchResults); - setRefresh(false); - }; - return ( <>