prevents the stop-sound being placed twice
This commit is contained in:
@@ -75,11 +75,7 @@ export class FocusPage implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (progress >= 1 || isNaN(progress)) {
|
if (progress >= 1 || isNaN(progress)) {
|
||||||
progress = 1;
|
|
||||||
if (this.duration === 0) {
|
if (this.duration === 0) {
|
||||||
this.forcedEndOfTimerChime.play().catch(error => {
|
|
||||||
console.error('Error playing audio:', error);
|
|
||||||
});
|
|
||||||
clearInterval(this.interval);
|
clearInterval(this.interval);
|
||||||
this.timerStarted = null;
|
this.timerStarted = null;
|
||||||
}
|
}
|
||||||
@@ -136,6 +132,9 @@ export class FocusPage implements OnInit, OnDestroy {
|
|||||||
this.state = FocusState.STOPPED;
|
this.state = FocusState.STOPPED;
|
||||||
this.stopStatsCounter();
|
this.stopStatsCounter();
|
||||||
this.startTimer(0);
|
this.startTimer(0);
|
||||||
|
this.forcedEndOfTimerChime.play().catch(error => {
|
||||||
|
console.error('Error playing audio:', error);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private stopStatsCounter() {
|
private stopStatsCounter() {
|
||||||
@@ -149,7 +148,7 @@ export class FocusPage implements OnInit, OnDestroy {
|
|||||||
this.state = FocusState.FOCUS;
|
this.state = FocusState.FOCUS;
|
||||||
this.stopStatsCounter();
|
this.stopStatsCounter();
|
||||||
this.focusService.startFocus();
|
this.focusService.startFocus();
|
||||||
this.startTimer(1); // 25
|
this.startTimer(0.3); // 25
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
@@ -175,6 +174,6 @@ export class FocusPage implements OnInit, OnDestroy {
|
|||||||
this.state = FocusState.LONG_BREAK;
|
this.state = FocusState.LONG_BREAK;
|
||||||
this.stopStatsCounter();
|
this.stopStatsCounter();
|
||||||
this.focusService.startLongBreak();
|
this.focusService.startLongBreak();
|
||||||
this.startTimer(0.3); // 15
|
this.startTimer(0.2); // 15
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user