From e7e13a623a9e87c8d1ee40cb9dc2cebc8c901d47 Mon Sep 17 00:00:00 2001 From: Billy Brawner Date: Sun, 18 Sep 2016 20:45:43 +0000 Subject: [PATCH] Fixed issues with sound not playing and skip back not working --- js/app.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/js/app.js b/js/app.js index 0076369..85e9a16 100644 --- a/js/app.js +++ b/js/app.js @@ -112,8 +112,8 @@ if (!window.indexedDB) { $scope.newTimerClosed = false; $scope.showTimerInterface = false; $scope.setPeriod = function(period, playBeep) { - if (typeof period == "undefined") { - period = true; + if (typeof playBeep == "undefined") { + playBeep = true; } clearInterval($scope.countdown); $scope[period].active = true; @@ -240,15 +240,8 @@ if (!window.indexedDB) { }; $scope.stepBack = function() { if ($scope.warmUp.active) { - if ($scope.cycle > 1) { - $scope.warmUp.active = false; - $scope.cycle--; - $scope.setPeriod('highIntensity'); - return; - } else { - $scope.resetTimer(); - return; - } + $scope.resetTimer(); + return; }; if ($scope.lowIntensity.active) { $scope.lowIntensity.active = false; @@ -271,6 +264,8 @@ if (!window.indexedDB) { }; if ($scope.rest.active) { $scope.rest.active = false; + $scope.cycle--; + $scope.round = $scope.timer.rounds; $scope.setPeriod('highIntensity'); return; }