diff --git a/navigator/components/FileUpload.js b/navigator/components/FileUpload.js index 3ceb895..e5877f3 100644 --- a/navigator/components/FileUpload.js +++ b/navigator/components/FileUpload.js @@ -41,7 +41,6 @@ export class FileUpload { this.reader = new FileReader(); this.chunks = this.slice_file(file); this.chunk_index = 0; - this.timestamp = Date.now(); this.modal_prompt = new ModalPrompt(); this.using_webkit = true; this.make_html_element(); @@ -127,6 +126,7 @@ export class FileUpload { } async upload() { + this.timestamp = Date.now(); this.dom_element.style.display = "flex"; this.proc = cockpit.spawn(["/usr/share/cockpit/navigator/scripts/write-chunks.py3", this.path], {err: "out", superuser: "try"}); this.proc.fail((e, data) => { @@ -164,7 +164,7 @@ export class FileUpload { } this.done(); } - this.update_rates_interval = setInterval(this.display_xfr_rate.bind(this), 2000); + this.update_rates_interval = setInterval(this.display_xfr_rate.bind(this), 1000); } /** diff --git a/navigator/functions.js b/navigator/functions.js index a44097f..0dc0853 100644 --- a/navigator/functions.js +++ b/navigator/functions.js @@ -70,9 +70,7 @@ export function format_time_remaining(seconds_) { if (hours) { out = String(hours).padStart(2, '0') + ":"; } - if (minutes) { - out += String(minutes).padStart(2, '0') + ":"; - } + out += String(minutes).padStart(2, '0') + ":"; out += String(seconds).padStart(2, '0'); return out; }