Fix jittering during download by padding the numbers
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
5e2ecd72a1
commit
f13f11d255
1 changed files with 5 additions and 3 deletions
|
@ -176,9 +176,11 @@ export default class SettingsView extends Vue {
|
|||
current = `${(this.downloadProgress.progress / 2) | 0}`;
|
||||
total = `${(this.downloadProgress.total / 2) | 0}`;
|
||||
} else {
|
||||
current = `${Math.round(this.downloadProgress.progress / 10485.76) /
|
||||
100}`;
|
||||
total = `${Math.round(this.downloadProgress.total / 10485.76) / 100} MB`;
|
||||
const currentNum =
|
||||
Math.round(this.downloadProgress.progress / 10485.76) / 100;
|
||||
current = currentNum.toString().padEnd(currentNum < 10 ? 4 : 5, "0");
|
||||
const totalNum = Math.round(this.downloadProgress.total / 10485.76) / 100;
|
||||
total = totalNum.toString().padEnd(totalNum < 10 ? 4 : 5, "0") + " MB";
|
||||
}
|
||||
const percent = Math.round(
|
||||
(this.downloadProgress.progress / this.downloadProgress.total) * 100
|
||||
|
|
Loading…
Reference in a new issue