Skip to content

Commit

Permalink
Don't show progress > 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed Jun 13, 2023
1 parent 8fe4857 commit 6cb62e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web_viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
const status_element = document.getElementById('status');
function progress({ loaded, total_bytes }) {
if (total_bytes != null) {
status_element.innerHTML = Math.round(loaded / total_bytes * 100) + '%';
status_element.innerHTML = Math.round(Math.min(loaded / total_bytes * 100, 100)) + '%';
} else {
status_element.innerHTML = (loaded / (1024 * 1024)).toFixed(1) + 'MiB'
}
Expand Down
2 changes: 1 addition & 1 deletion web_viewer/index_bundled.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@
const status_element = document.getElementById('status');
function progress({ loaded, total_bytes }) {
if (total_bytes != null) {
status_element.innerHTML = Math.round(loaded / total_bytes * 100) + '%';
status_element.innerHTML = Math.round(Math.min(loaded / total_bytes * 100, 100)) + '%';
} else {
status_element.innerHTML = (loaded / (1024 * 1024)).toFixed(1) + 'MiB'
}
Expand Down

0 comments on commit 6cb62e9

Please sign in to comment.