From ab3d8687943f8b71514f9dcc99b659ba8d925c51 Mon Sep 17 00:00:00 2001 From: mahuntington Date: Fri, 25 Aug 2023 19:15:25 -0400 Subject: [PATCH] local storage remembers time --- src/components/timer.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/timer.vue b/src/components/timer.vue index 7d01587..8d1023a 100644 --- a/src/components/timer.vue +++ b/src/components/timer.vue @@ -71,6 +71,7 @@ this.running = true; this.intervalID = setInterval(()=>{ this.totalSeconds = getAccumulatedSeconds(Date.now(), this.startTime) + this.savedPreviousSeconds; + window.localStorage.setItem('lastTotalSeconds', this.totalSeconds); }, 100); }, updateSavedPreviousSeconds(event){ @@ -87,7 +88,7 @@ }, setSecondsManually(){ this.totalSeconds = this.manualHours*60*60 + this.manualMinutes*60 + this.manualSeconds; - console.log(this.manualHours, this.manualMinutes, this.manualSeconds); + window.localStorage.setItem('lastTotalSeconds', this.totalSeconds); } }, mounted() {