Skip to content

Commit

Permalink
Removed currentStatus local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Drahkir committed Jun 19, 2017
1 parent dc253c9 commit af8ec85
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/assets/javascripts/TT.js
Expand Up @@ -169,16 +169,15 @@ var TT = function() {
stateStart(timer);

(function tick() {
var currentStatus = getStatus();
if('pause_on' == currentStatus) {
if('pause_on' == getStatus()) {
pausedDate = new Date();
status = 'paused';
}
else if('pause_off' == currentStatus) {
else if('pause_off' == getStatus()) {
startDate = new Date() - (pausedDate - startDate) + 1000;
status = 'running';
}
if('running' == currentStatus) {
if('running' == getStatus()) {
var msPassed = new Date() - startDate;
timer = Math.round(duration - msPassed/1000);

Expand All @@ -190,7 +189,7 @@ var TT = function() {
}
else {
timerInterval = setTimeout(tick, 1000);
if($('#ticking_sound_switch').is(':checked') && 'running' == currentStatus) {
if($('#ticking_sound_switch').is(':checked') && 'running' == getStatus()) {
soundManager.setVolume(settings.timerTickingSoundId, volume).play();
}
}
Expand Down

0 comments on commit af8ec85

Please sign in to comment.