Lovely file upload alerts

This commit is contained in:
Michael Shamoon
2021-01-26 02:32:45 -08:00
parent 5da2bced94
commit 62d3c27e4b
4 changed files with 48 additions and 17 deletions

View File

@@ -16,7 +16,7 @@ export class FileStatus {
taskId: string
phase: FileStatusPhase = FileStatusPhase.STARTED
phase: FileStatusPhase = FileStatusPhase.STARTED
currentPhaseProgress: number
@@ -33,7 +33,8 @@ export class FileStatus {
case FileStatusPhase.UPLOADING:
return this.currentPhaseProgress / this.currentPhaseMaxProgress * 0.2
case FileStatusPhase.PROCESSING:
return this.currentPhaseProgress / this.currentPhaseMaxProgress * 0.8 + 0.2
if (this.currentPhaseProgress > 100) this.currentPhaseProgress = 0
return (this.currentPhaseProgress / this.currentPhaseMaxProgress * 0.8) + 0.2
case FileStatusPhase.SUCCESS:
case FileStatusPhase.FAILED:
return 1.0