Fix and ignore new Eslint react rules for now

This commit is contained in:
MerlinScheurer 2025-12-08 23:26:47 +01:00
parent 877e7d0cf8
commit 2d0253a4b8
6 changed files with 15 additions and 8 deletions

View File

@ -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);

View File

@ -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 (

View File

@ -108,7 +108,6 @@ const Playlist = () => {
}
setRefresh(false);
})();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
playlistId,
userConfig.hide_watched_playlist,

View File

@ -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 (
<>
<title>TubeArchivist</title>

View File

@ -182,11 +182,13 @@ const SettingsApplication = () => {
};
useEffect(() => {
// eslint-disable-next-line react-hooks/set-state-in-effect
fetchData();
}, []);
useEffect(() => {
if (refresh) {
// eslint-disable-next-line react-hooks/set-state-in-effect
fetchData();
setRefresh(false);
}

View File

@ -103,6 +103,7 @@ const SettingsScheduling = () => {
}, [refresh]);
useEffect(() => {
// eslint-disable-next-line react-hooks/set-state-in-effect
setRefresh(true);
}, []);