Synchronize live speed telemetry, preserve known package sizes, refine responsive download status presentation, improve progress contrast and accessibility, simplify account creation, and prepare the verified v2.0.15 desktop release.
13 lines
453 B
TypeScript
13 lines
453 B
TypeScript
export function mergeKnownTotalBytes(
|
|
currentTotalBytes: number | null | undefined,
|
|
replacementTotalBytes: number | null | undefined
|
|
): number | null {
|
|
if (replacementTotalBytes != null && Number.isFinite(replacementTotalBytes) && replacementTotalBytes > 0) {
|
|
return replacementTotalBytes;
|
|
}
|
|
if (currentTotalBytes != null && Number.isFinite(currentTotalBytes) && currentTotalBytes > 0) {
|
|
return currentTotalBytes;
|
|
}
|
|
return null;
|
|
}
|