diff --git a/src/components/timer.vue b/src/components/timer.vue index 12e9590..da75fd6 100644 --- a/src/components/timer.vue +++ b/src/components/timer.vue @@ -171,7 +171,11 @@ }, mounted() { this.practice_category_id = this.currentWorkingCategory.id - this.totalSeconds = parseInt(window.localStorage.getItem('lastTotalSeconds')) + if(window.localStorage.getItem('lastTotalSeconds')){ + this.totalSeconds = parseInt(window.localStorage.getItem('lastTotalSeconds')) + } else { + this.totalSeconds = 0 + } this.setManualTime(this.totalSeconds) this.savedPreviousSeconds = this.totalSeconds window.onbeforeunload = this.confirmClose