diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index afd0db9c..f6ef7aff 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -695,8 +695,9 @@ function Donut(uc, st) { } if (++r.tc >= 10) { + var s = r.eta === null ? 'paused' : r.eta > 60 ? shumantime(r.eta) : (r.eta + 's'); wintitle("{0}%, {1}, #{2}, ".format( - f2f(v * 100 / t, 1), shumantime(r.eta), st.files.length - st.nfile.upload), true); + f2f(v * 100 / t, 1), s, st.files.length - st.nfile.upload), true); r.tc = 0; } diff --git a/copyparty/web/util.js b/copyparty/web/util.js index ca9a9aa2..94b2f2e5 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -886,8 +886,11 @@ if (window.Number && Number.isFinite) function f2f(val, nd) { // 10.toFixed(1) returns 10.00 for certain values of 10 - if (!isNum(val)) - val = 999; + if (!isNum(val)) { + val = parseFloat(val); + if (!isNum(val)) + val = 999; + } val = (val * Math.pow(10, nd)).toFixed(0).split('.')[0]; return nd ? (val.slice(0, -nd) || '0') + '.' + val.slice(-nd) : val; }