summaryrefslogtreecommitdiffstats
path: root/deluge/ui
diff options
context:
space:
mode:
authorDjLegolas <djlegolas@protonmail.com>2021-12-21 23:32:39 +0200
committerCalum Lind <calumlind+deluge@gmail.com>2021-12-22 22:04:24 +0000
commit3b11613cc77ddaf8ece28cafa1bd9e680799d48c (patch)
tree4396fea973d413dfeb097e83013304087f063d28 /deluge/ui
parenta2d0cb7141449198222fd4c66f4418d2efb8bebf (diff)
downloaddeluge-3b11613cc77ddaf8ece28cafa1bd9e680799d48c.tar.gz
deluge-3b11613cc77ddaf8ece28cafa1bd9e680799d48c.tar.bz2
deluge-3b11613cc77ddaf8ece28cafa1bd9e680799d48c.zip
[WebUI] Fixed ETA sorting in WebUI
When sorting the according to ETA values, all torrents with infinite value were being considered a lower value (INF -> 12 -> 32) instead of largest (12 -> 32 -> INF). This is due to the fact that the INF symbol is placed to lower value (<= 0). Now the lower values are being treated as the largest JS number when sorting. Closes: https://dev.deluge-torrent.org/ticket/3413 Closes: https://github.com/deluge-torrent/deluge/pull/321
Diffstat (limited to 'deluge/ui')
-rw-r--r--deluge/ui/web/js/deluge-all/TorrentGrid.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/deluge/ui/web/js/deluge-all/TorrentGrid.js b/deluge/ui/web/js/deluge-all/TorrentGrid.js
index f664c765c..198ec279f 100644
--- a/deluge/ui/web/js/deluge-all/TorrentGrid.js
+++ b/deluge/ui/web/js/deluge-all/TorrentGrid.js
@@ -67,7 +67,9 @@
}
function etaSorter(eta) {
- return eta * -1;
+ if (eta === 0) return Number.MAX_VALUE;
+ if (eta <= -1) return Number.MAX_SAFE_INTEGER;
+ return eta;
}
function dateOrNever(date) {
@@ -75,7 +77,9 @@
}
function timeOrInf(time) {
- return time < 0 ? '&infin;' : ftime(time);
+ if (time === 0) return '';
+ if (time <= -1) return '&infin;';
+ return ftime(time);
}
/**