react-compound-timer
Advanced tools
Comparing version 1.1.9 to 1.1.10
@@ -47,10 +47,20 @@ "use strict"; | ||
TimerModel.prototype.setLastUnit = function (lastUnit) { | ||
this.pause(); | ||
this.lastUnit = lastUnit; | ||
this.resume(true); | ||
if (this.innerState.isPlaying()) { | ||
this.pause(); | ||
this.lastUnit = lastUnit; | ||
this.resume(true); | ||
} | ||
else { | ||
this.lastUnit = lastUnit; | ||
} | ||
}; | ||
TimerModel.prototype.setTimeToUpdate = function (interval) { | ||
this.pause(); | ||
this.timeToUpdate = interval; | ||
this.resume(); | ||
if (this.innerState.isPlaying()) { | ||
this.pause(); | ||
this.timeToUpdate = interval; | ||
this.resume(); | ||
} | ||
else { | ||
this.timeToUpdate = interval; | ||
} | ||
}; | ||
@@ -57,0 +67,0 @@ TimerModel.prototype.setDirection = function (direction) { |
{ | ||
"name": "react-compound-timer", | ||
"version": "1.1.9", | ||
"version": "1.1.10", | ||
"description": "Timer compound react component", | ||
@@ -5,0 +5,0 @@ "main": "build", |
@@ -68,11 +68,19 @@ import getTimeParts from '../helpers/getTimeParts'; | ||
public setLastUnit(lastUnit: Unit) { | ||
this.pause(); | ||
this.lastUnit = lastUnit; | ||
this.resume(true); | ||
if (this.innerState.isPlaying()) { | ||
this.pause(); | ||
this.lastUnit = lastUnit; | ||
this.resume(true); | ||
} else { | ||
this.lastUnit = lastUnit; | ||
} | ||
} | ||
public setTimeToUpdate(interval: number) { | ||
this.pause(); | ||
this.timeToUpdate = interval; | ||
this.resume(); | ||
if (this.innerState.isPlaying()) { | ||
this.pause(); | ||
this.timeToUpdate = interval; | ||
this.resume(); | ||
} else { | ||
this.timeToUpdate = interval; | ||
} | ||
} | ||
@@ -79,0 +87,0 @@ |
Sorry, the diff of this file is not supported yet
83710
1633