| {{category.category_id}} |
{{category.category}} |
{{category.chunks_practiced}} |
diff --git a/src/components/timer.vue b/src/components/timer.vue
index 6cd5000..5b4d091 100644
--- a/src/components/timer.vue
+++ b/src/components/timer.vue
@@ -24,6 +24,7 @@
}
export default {
+ props: ['currentWorkingCategoryID'],
data() {
return {
categories:[],
@@ -32,7 +33,6 @@
savedPreviousSeconds:0,
totalSeconds:0,
description:'',
- practice_category_id:0,
comments:'',
manualHours:0,
manualMinutes:0,
@@ -158,12 +158,18 @@
}
},
mounted() {
+ this.practice_category_id = this.currentWorkingCategoryID
axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'categories').then((response)=>{
this.categories = response.data
})
this.totalSeconds = parseInt(window.localStorage.getItem('lastTotalSeconds'))
this.savedPreviousSeconds = this.totalSeconds
window.onbeforeunload = this.confirmClose
+ },
+ watch: {
+ currentWorkingCategoryID(newValue){
+ this.practice_category_id = newValue
+ }
}
}