File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
packages/cli-kit/src/private/node/ui/components Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -81,14 +81,9 @@ function Tasks<TContext>({
8181 const { twoThirds} = useLayout ( )
8282 let loadingBar = new Array ( twoThirds ) . fill ( loadingBarChar ) . join ( '' )
8383 if ( noColor ?? ! shouldDisplayColors ( ) ) {
84- // fill loading bar with the no color chars, repeating until the length is two thirds but only using a whole number repeat of the no color chars
85- const repeatCount = Math . floor ( twoThirds / gradualHillString . length )
86- if ( repeatCount === 0 ) {
87- const shortRepeatCount = Math . floor ( twoThirds / hillString . length )
88- loadingBar = hillString . repeat ( Math . max ( 1 , shortRepeatCount ) )
89- } else {
90- loadingBar = gradualHillString . repeat ( repeatCount )
91- }
84+ const fittingPattern = gradualHillString . length <= twoThirds ? gradualHillString : hillString
85+ const fullyFittingRepeats = Math . floor ( twoThirds / fittingPattern . length )
86+ loadingBar = fittingPattern . repeat ( Math . max ( 1 , fullyFittingRepeats ) )
9287 }
9388 // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9489 const [ currentTask , setCurrentTask ] = useState < Task < TContext > > ( tasks [ 0 ] ! )
You can’t perform that action at this time.
0 commit comments