Fix Download page not refetching on page change

This commit is contained in:
MerlinScheurer 2025-03-29 10:56:26 +01:00
parent 0d1bdb8904
commit 947ec803b3
2 changed files with 11 additions and 7 deletions

View File

@ -80,7 +80,11 @@ const Base = () => {
useEffect(() => {
if (currentPageFromUrl !== currentPage) {
setSearchParams(params => {
params.set('page', currentPage.toString());
if (currentPage == 0) {
params.delete('page');
} else {
params.set('page', currentPage.toString());
}
return params;
});

View File

@ -117,7 +117,11 @@ const Download = () => {
})();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [refresh, showIgnored, currentPage]);
}, [refresh]);
useEffect(() => {
setRefresh(true);
}, [channelFilterFromUrl, currentPage, showIgnored]);
useEffect(() => {
(async () => {
@ -127,10 +131,6 @@ const Download = () => {
})();
}, [lastVideoCount, showIgnored]);
useEffect(() => {
setRefresh(true);
}, [channelFilterFromUrl]);
return (
<>
<title>TA | Downloads</title>
@ -262,7 +262,7 @@ const Download = () => {
const params = searchParams;
if (value !== 'all') {
params.append('channel', value);
params.set('channel', value);
} else {
params.delete('channel');
}