local storage remembers time

mic_level
mahuntington 2 years ago
parent 221dea7b58
commit ab3d868794

@ -71,6 +71,7 @@
this.running = true; this.running = true;
this.intervalID = setInterval(()=>{ this.intervalID = setInterval(()=>{
this.totalSeconds = getAccumulatedSeconds(Date.now(), this.startTime) + this.savedPreviousSeconds; this.totalSeconds = getAccumulatedSeconds(Date.now(), this.startTime) + this.savedPreviousSeconds;
window.localStorage.setItem('lastTotalSeconds', this.totalSeconds);
}, 100); }, 100);
}, },
updateSavedPreviousSeconds(event){ updateSavedPreviousSeconds(event){
@ -87,7 +88,7 @@
}, },
setSecondsManually(){ setSecondsManually(){
this.totalSeconds = this.manualHours*60*60 + this.manualMinutes*60 + this.manualSeconds; 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() { mounted() {

Loading…
Cancel
Save