category choose might work in timer

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

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

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

Loading…
Cancel
Save