Skip to content

Commit 06cc8aa

Browse files
committed
Fix merge
1 parent d8e9e97 commit 06cc8aa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

coffee/react-countdown-clock.coffee

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ ReactCountdownClock = CreateReactClass
3030

3131
componentDidMount: ->
3232
@_seconds = @props.seconds
33+
if @props.maxSeconds > 0
34+
@_percentOfMax = @_seconds / @props.maxSeconds
35+
else
36+
@_percentOfMax = 1
3337
@_setupTimer()
3438

3539
componentWillUnmount: ->
@@ -166,7 +170,7 @@ ReactCountdownClock = CreateReactClass
166170
@props.fontSize
167171

168172
_drawTimer: ->
169-
percent = @_fraction * @_seconds + 1.5
173+
percent = @_fraction * @_seconds * @_percentOfMax + 1.5
170174
formattedTime = @_formattedTime()
171175
text = if (@props.paused && @props.pausedText?) then @props.pausedText else formattedTime
172176

0 commit comments

Comments
 (0)