mirror of
https://github.com/sct/overseerr.git
synced 2025-12-28 16:56:19 +01:00
fix: added a refresh interval if download status is in progress (#3275)
* fix: added a refresh interval if download status is in progress * refactor: switched to a function instead of useEffect * feat: added editable download sync schedule
This commit is contained in:
18
src/utils/refreshIntervalHelper.ts
Normal file
18
src/utils/refreshIntervalHelper.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { DownloadingItem } from '@server/lib/downloadtracker';
|
||||
|
||||
export const refreshIntervalHelper = (
|
||||
downloadItem: {
|
||||
downloadStatus: DownloadingItem[] | undefined;
|
||||
downloadStatus4k: DownloadingItem[] | undefined;
|
||||
},
|
||||
timer: number
|
||||
) => {
|
||||
if (
|
||||
(downloadItem.downloadStatus ?? []).length > 0 ||
|
||||
(downloadItem.downloadStatus4k ?? []).length > 0
|
||||
) {
|
||||
return timer;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user