react-component-countdown-timer
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -78,4 +78,4 @@ "use strict"; | ||
day = day.toString().length === 1 ? "0".concat(day) : day; | ||
minutes = Number.parseInt(minutes.toString().length === 1 ? "0".concat(minutes) : minutes); | ||
seconds = Number.parseInt(seconds.toString().length === 1 ? "0".concat(seconds) : seconds); | ||
minutes = minutes.toString().length === 1 ? "0".concat(minutes) : minutes; | ||
seconds = seconds.toString().length === 1 ? "0".concat(seconds) : seconds; | ||
hours = hours.toString().length === 1 ? "0".concat(hours) : hours; | ||
@@ -209,2 +209,7 @@ | ||
}, { | ||
key: "componentWillUnmount", | ||
value: function componentWillUnmount() { | ||
clearInterval(this.timer); | ||
} | ||
}, { | ||
key: "handleStart", | ||
@@ -217,8 +222,8 @@ value: function handleStart() { | ||
if (newCount === 0) { | ||
_this2.props.onEnd(); | ||
} | ||
_this2.setState({ | ||
count: newCount >= 0 ? newCount : 0 | ||
}, function () { | ||
if (_this2.state.count === 0) { | ||
_this2.props.onEnd(); | ||
} | ||
}); | ||
@@ -225,0 +230,0 @@ }, 1000); |
{ | ||
"name": "react-component-countdown-timer", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Count down timer component for react", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41609
617