mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 04:53:40 +00:00
loading progress NaN fix
This commit is contained in:
committed by
Aiden McClelland
parent
d38da2231e
commit
c9d77e99af
@@ -28,17 +28,19 @@ export function packageLoadingProgress (
|
||||
unpackWeight * unpacked,
|
||||
)
|
||||
|
||||
|
||||
const denominator = Math.floor(
|
||||
size * (downloadWeight + validateWeight + unpackWeight),
|
||||
)
|
||||
const totalProgress = Math.floor(100 * numerator / denominator)
|
||||
|
||||
return {
|
||||
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}%`,
|
||||
display: totalProgress > 98 ? 'Finalizing...' : `Installing... ${totalProgress}%`,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user