category choose might work in timer

practiced-songs
Matthew Huntington 1 year ago
parent b51a8f4746
commit 654bc1168d

@ -39,6 +39,7 @@
<section id="timer">
<Status ref="statusRef"/>
<Timer
v-if="categories.length > 0"
@loggedTime="refreshPage"
:categories="categories"
:instruments="instruments"

@ -4,7 +4,7 @@
import { getHours, getMinutes, createTimeObj, getAccumulatedSeconds, formatSeconds } from '../libs/time.js'
export default {
props: ['categories', 'currentWorkingCategoryID', 'instruments'],
props: ['categories', 'currentWorkingCategory', 'instruments'],
data() {
return {
running: false,
@ -146,20 +146,20 @@
return false
}
},
handleCategoryChange(newValue){
this.practice_category_id = newValue
handleCategoryChange(chosenCategory){
this.practice_category_id = chosenCategory.id
}
},
mounted() {
this.practice_category_id = this.currentWorkingCategoryID
this.practice_category_id = this.currentWorkingCategory.id
this.totalSeconds = parseInt(window.localStorage.getItem('lastTotalSeconds'))
this.setManualTime(this.totalSeconds)
this.savedPreviousSeconds = this.totalSeconds
window.onbeforeunload = this.confirmClose
},
watch: {
currentWorkingCategoryID(newValue){
this.practice_category_id = newValue
currentWorkingCategory(chosenCategory){
this.practice_category_id = chosenCategory.id
}
}
}
@ -187,8 +187,7 @@
<label>Practice Category</label>
<CategoryChooser
@update="handleCategoryChange"
v-if="categories.length > 0"
:currentWorkingCategoryID="practice_category_id"
:currentWorkingCategory="currentWorkingCategory"
:instruments="instruments"
:categories="categories" />
<input type="Submit"/>

Loading…
Cancel
Save