finalizing bug fix

This commit is contained in:
Drew Ansbacher
2021-12-01 14:49:14 -07:00
committed by Aiden McClelland
parent 82602af601
commit 6c3e99f3e1
3 changed files with 8 additions and 4 deletions

View File

@@ -31,13 +31,14 @@ export function packageLoadingProgress (
const denominator = Math.floor(
size * (downloadWeight + validateWeight + unpackWeight),
)
const totalProgress = Math.floor(100 * numerator / denominator)
return {
totalProgress: Math.floor((100 * numerator) / denominator),
totalProgress,
downloadProgress: Math.floor((100 * downloaded) / size),
validateProgress: Math.floor((100 * validated) / size),
unpackProgress: Math.floor((100 * unpacked) / size),
isComplete: downloadComplete && validationComplete && unpackComplete,
display: totalProgress > 98 ? 'Finalizing' : `${totalProgress}%`,
}
}
@@ -47,4 +48,5 @@ export interface ProgressData {
validateProgress: number
unpackProgress: number
isComplete: boolean
display: string
}