Pause, cancel & resume backup media download
This commit is contained in:
parent
65539b1419
commit
028a3f3ef0
28 changed files with 958 additions and 141 deletions
|
@ -57,3 +57,23 @@ export function safeParseBigint(
|
|||
}
|
||||
return BigInt(value);
|
||||
}
|
||||
|
||||
export function roundFractionForProgressBar(fractionComplete: number): number {
|
||||
if (fractionComplete <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fractionComplete >= 1) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (fractionComplete <= 0.01) {
|
||||
return 0.01;
|
||||
}
|
||||
|
||||
if (fractionComplete >= 0.99) {
|
||||
return 0.99;
|
||||
}
|
||||
|
||||
return Math.round(fractionComplete * 100) / 100;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue