From 69d202079d4e6d731472ee6288c5de0d96492cec Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Mon, 1 Apr 2024 20:48:31 -0400 Subject: [PATCH] timer has dark green background when initially started and no changes to threshold --- src/components/timer.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/timer.vue b/src/components/timer.vue index ccecd82..d18c948 100644 --- a/src/components/timer.vue +++ b/src/components/timer.vue @@ -84,15 +84,18 @@ const arraySum = array.reduce((a, value) => a + value, 0); this.micLevel = arraySum / array.length; - if(this.micLevel > this.micThreshold){ - this.micThresholdExceeded = true; - } else { + if(this.micLevel < this.micThreshold){ 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; window.localStorage.setItem('lastTotalSeconds', this.totalSeconds);