Web UI: refresh live torrents often

This commit is contained in:
Igor Katson 2023-12-06 12:20:19 +00:00
parent 2d43f41664
commit dd355b0a74
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
2 changed files with 1 additions and 5 deletions

View file

@ -314,16 +314,12 @@ const Torrent: React.FC<{
useEffect(() => customSetInterval((async () => {
const errorInterval = 10000;
const liveInterval = 1000;
const finishedInterval = 10000;
const nonLiveInterval = 10000;
return API.getTorrentStats(torrent.id).then((stats) => {
updateStatsResponse(stats);
return stats;
}).then((stats) => {
if (stats.finished) {
return finishedInterval;
}
if (stats.state == STATE_INITIALIZING || stats.state == STATE_LIVE) {
return liveInterval;
}