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

@@ -109,7 +109,9 @@
<ion-text *ngIf="(pkg.manifest.version | compareEmver : localPkg.manifest.version) === 1" color="warning">Update Available</ion-text>
</p>
<p *ngIf="[PackageState.Installing, PackageState.Updating] | includes : localPkg.state">
<ion-text color="primary">{{ localPkg.state | titlecase }}...{{ (localPkg['install-progress'] | installState).totalProgress }}%</ion-text>
<ion-text color="primary">{{ localPkg.state | titlecase }}...
<span>{{ (localPkg['install-progress'] | installState).display }}</span>
</ion-text>
</p>
<p *ngIf="localPkg.state === PackageState.Removing">
<ion-text color="warning">{{ localPkg.state | titlecase }}</ion-text>

View File

@@ -32,7 +32,7 @@
</p>
<!-- installing, updating -->
<p *ngIf="[PackageState.Installing, PackageState.Updating] | includes : localPkg.state">
<ion-text color="primary">{{ localPkg.state | titlecase }}...{{ (localPkg['install-progress'] | installState).totalProgress }}%</ion-text>
<ion-text color="primary">{{ localPkg.state | titlecase }}...{{ (localPkg['install-progress'] | installState).display }}</ion-text>
</p>
<!-- removing -->
<p *ngIf="localPkg.state === PackageState.Removing">

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
}