Skip to content

Commit 7bd64d9

Browse files
authored
Update timer.js
added custom times warning
1 parent 93f036b commit 7bd64d9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

js/timer.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ let isPaused = false,
5858
isVibrateEnabled = false,
5959
isClappingEnabled = false,
6060
isContestMode = false,
61-
isCustom = true,
61+
isCustom = false,
6262
isFirstRun = true,
6363
clappingStarted = false,
6464
multipleEnabled = false;
@@ -257,8 +257,11 @@ function resizeScreen(){
257257

258258
function pauseTimer(event) {
259259
if (minimum === 0 && maximum === 0 && average === 0) {
260-
showSnackbar(lngObject.chooseTime);
261-
return;
260+
if (isCustom)
261+
showSnackbar(lngObject.notSaved);
262+
else
263+
showSnackbar(lngObject.chooseTime);
264+
return;
262265
}
263266

264267
btnInvert.disabled = true;
@@ -311,8 +314,10 @@ function changeEventHandler(event) {
311314
update(wholeTime, wholeTime); //refreshes progress bar
312315
displayTimeLeft(wholeTime);
313316
}
314-
else
317+
else {
318+
isCustom = true;
315319
dialogCustomTimes.showModal();
320+
}
316321
}
317322

318323
function startBeep() {
@@ -509,7 +514,6 @@ function saveChanges() {
509514
else if (avgTime >= maxTime)
510515
showSnackbar(lngObject.errorMax);
511516
else {
512-
isCustom = true;
513517
minimum = minTime;
514518
average = avgTime;
515519
maximum = maxTime;

0 commit comments

Comments
 (0)