File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -443,20 +443,24 @@ You can select a file to upload from the main page by clicking the 'Choose File.
443
443
// Calculate percentage based on currentSize and totalSize
444
444
// if data is available before actual percent
445
445
const percent =
446
- this . percent || ( this . currentSize && this . totalSize )
447
- ? ( ( this . currentSize / this . totalSize ) * 100 ) . toFixed ( 0 )
448
- : 0 ;
446
+ this . currentSize && this . totalSize
447
+ ? Math . max ( this . percent , ( this . currentSize / this . totalSize ) * 100 )
448
+ : this . percent ;
449
+ // Round up <1 percentages
450
+ const displayPercent = percent ? Math . max ( percent , 1 ) : undefined ;
449
451
450
452
return html `
451
453
< progress
452
454
id ="progress "
453
455
class ="progress is-primary is-large "
454
- value =${ ifDefined ( percent || undefined ) }
456
+ value =${ ifDefined ( displayPercent ) }
455
457
max ="100"
456
458
> </ progress >
457
- ${ percent
459
+ ${ displayPercent
458
460
? html `
459
- < label class ="progress-label " for ="progress "> ${ percent } %</ label >
461
+ < label class ="progress-label " for ="progress "
462
+ > ${ displayPercent } %</ label
463
+ >
460
464
`
461
465
: nothing }
462
466
${ this . currentSize && this . totalSize
You can’t perform that action at this time.
0 commit comments