Skip to content

Commit

Permalink
Fix updater divide by 0
Browse files Browse the repository at this point in the history
  • Loading branch information
rnd-ash committed Jan 23, 2024
1 parent 7e021a0 commit 2b194bc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions config_app/src/ui/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,14 @@ impl InterfacePage for UpdatePage {
let spd = (1000.0 * current as f32
/ f_start.elapsed().as_millis() as f32)
as u32;
let eta = (total - current) / spd;
ui.label(format!("Avg {:.0} bytes/sec", spd));
ui.label(format!("ETA: {:02}:{:02} seconds remaining", eta/60, eta % 60));
if spd != 0 {
let eta = (total - current) / spd;
ui.label(format!("Avg {:.0} bytes/sec", spd));
ui.label(format!("ETA: {:02}:{:02} seconds remaining", eta/60, eta % 60));
} else {
ui.label("Please wait...");
}

}
ui.label(text);
}
Expand Down

0 comments on commit 2b194bc

Please sign in to comment.