Skip to content

Commit

Permalink
Update timer.js
Browse files Browse the repository at this point in the history
added custom times warning
  • Loading branch information
FANMixco authored Mar 15, 2019
1 parent 93f036b commit 7bd64d9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions js/timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ let isPaused = false,
isVibrateEnabled = false,
isClappingEnabled = false,
isContestMode = false,
isCustom = true,
isCustom = false,
isFirstRun = true,
clappingStarted = false,
multipleEnabled = false;
Expand Down Expand Up @@ -257,8 +257,11 @@ function resizeScreen(){

function pauseTimer(event) {
if (minimum === 0 && maximum === 0 && average === 0) {
showSnackbar(lngObject.chooseTime);
return;
if (isCustom)
showSnackbar(lngObject.notSaved);
else
showSnackbar(lngObject.chooseTime);
return;
}

btnInvert.disabled = true;
Expand Down Expand Up @@ -311,8 +314,10 @@ function changeEventHandler(event) {
update(wholeTime, wholeTime); //refreshes progress bar
displayTimeLeft(wholeTime);
}
else
else {
isCustom = true;
dialogCustomTimes.showModal();
}
}

function startBeep() {
Expand Down Expand Up @@ -509,7 +514,6 @@ function saveChanges() {
else if (avgTime >= maxTime)
showSnackbar(lngObject.errorMax);
else {
isCustom = true;
minimum = minTime;
average = avgTime;
maximum = maxTime;
Expand Down

0 comments on commit 7bd64d9

Please sign in to comment.