Skip to content

Commit a7088aa

Browse files
committed
Ensured it is never less than 0
1 parent 00a7531 commit a7088aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coffee/react-countdown-clock.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module.exports = React.createClass
6262
setTimeout ( =>
6363
duration = Date.now() - start
6464
@setState
65-
seconds: @state.seconds - duration / 1000
65+
seconds: Math.max(0,@state.seconds - duration / 1000)
6666
@_tick() unless @state.seconds <= 0
6767
), 30
6868

0 commit comments

Comments
 (0)