mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 12:33:40 +00:00
refactor(app-show): refactor component (#961)
* refactor(app-show): refactor component * chore: remove precommit hook for the time being * chore: fix mutation by spreading Co-authored-by: Drew Ansbacher <drew.ansbacher@spiredigital.com>
This commit is contained in:
committed by
Aiden McClelland
parent
dbc159c82e
commit
5e681aa3fb
@@ -1,8 +1,13 @@
|
||||
import { InstallProgress } from 'src/app/services/patch-db/data-model'
|
||||
import { isEmptyObject } from './misc.util'
|
||||
|
||||
export function packageLoadingProgress (
|
||||
export function packageLoadingProgress(
|
||||
loadData: InstallProgress,
|
||||
): ProgressData {
|
||||
): ProgressData | null {
|
||||
if (isEmptyObject(loadData)) {
|
||||
return null
|
||||
}
|
||||
|
||||
let {
|
||||
downloaded,
|
||||
validated,
|
||||
@@ -28,11 +33,10 @@ export function packageLoadingProgress (
|
||||
unpackWeight * unpacked,
|
||||
)
|
||||
|
||||
|
||||
const denominator = Math.floor(
|
||||
size * (downloadWeight + validateWeight + unpackWeight),
|
||||
)
|
||||
const totalProgress = Math.floor(100 * numerator / denominator)
|
||||
const totalProgress = Math.floor((100 * numerator) / denominator)
|
||||
|
||||
return {
|
||||
totalProgress,
|
||||
|
||||
Reference in New Issue
Block a user