File tree 3 files changed +9
-10
lines changed
3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export const TemplateStats: FC<TemplateStatsProps> = ({
46
46
< span className = { styles . statsLabel } > { Language . buildTimeLabel } </ span >
47
47
48
48
< span className = { styles . statsValue } >
49
- { formatTemplateBuildTime ( template . active_user_count ) } { " " }
49
+ { formatTemplateBuildTime ( template . average_build_time_ms ) } { " " }
50
50
</ span >
51
51
</ div >
52
52
< div className = { styles . statsDivider } />
Original file line number Diff line number Diff line change @@ -18,18 +18,17 @@ const estimateFinish = (
18
18
templateAverage *= 1.2
19
19
20
20
const realPercentage = dayjs ( ) . diff ( startedAt ) / templateAverage
21
- // Showing a full bar is frustrating.
22
- const displayPercentage = Math . min ( realPercentage , 0.95 )
23
21
24
- if ( realPercentage > 1 ) {
25
- return [ displayPercentage , "Any moment now..." ]
22
+ // Showing a full bar is frustrating.
23
+ if ( realPercentage > 0.95 ) {
24
+ return [ 0.95 , "Any moment now..." ]
26
25
}
27
26
28
27
return [
29
- displayPercentage ,
30
- `${ dayjs
31
- . duration ( ( 1 - realPercentage ) * templateAverage )
32
- . humanize ( ) } remaining...`,
28
+ realPercentage ,
29
+ `~ ${ Math . ceil (
30
+ dayjs . duration ( ( 1 - realPercentage ) * templateAverage ) . asSeconds ( ) ,
31
+ ) } seconds remaining...`,
33
32
]
34
33
}
35
34
Original file line number Diff line number Diff line change @@ -16,5 +16,5 @@ export const formatTemplateActiveDevelopers = (num?: number): string => {
16
16
export const formatTemplateBuildTime = ( buildTimeMs : number ) : string => {
17
17
return buildTimeMs < 0
18
18
? "Unknown"
19
- : dayjs . duration ( buildTimeMs , "milliseconds" ) . humanize ( )
19
+ : ` ${ Math . round ( dayjs . duration ( buildTimeMs , "milliseconds" ) . asSeconds ( ) ) } s`
20
20
}
You can’t perform that action at this time.
0 commit comments