timer has dark green background when initially started and no changes to threshold

practiced-songs
Matt Huntington 2 years ago
parent b9f7eba63f
commit 69d202079d

@ -84,15 +84,18 @@
const arraySum = array.reduce((a, value) => a + value, 0); const arraySum = array.reduce((a, value) => a + value, 0);
this.micLevel = arraySum / array.length; this.micLevel = arraySum / array.length;
if(this.micLevel > this.micThreshold){ if(this.micLevel < this.micThreshold){
this.micThresholdExceeded = true;
} else {
this.secondsToSubtract++; this.secondsToSubtract++;
this.micThresholdExceeded = false;
} }
} }
if(this.micLevel >= this.micThreshold){
this.micThresholdExceeded = true;
} else {
this.micThresholdExceeded = false;
}
this.totalSeconds = getAccumulatedSeconds(Date.now(), this.startTime) - this.secondsToSubtract + this.savedPreviousSeconds; this.totalSeconds = getAccumulatedSeconds(Date.now(), this.startTime) - this.secondsToSubtract + this.savedPreviousSeconds;
window.localStorage.setItem('lastTotalSeconds', this.totalSeconds); window.localStorage.setItem('lastTotalSeconds', this.totalSeconds);

Loading…
Cancel
Save