ctrl+l loads category's latest session's description as description for current session

main
Matthew Huntington 5 months ago
parent 7cc7562d2a
commit 4de311abb4

@ -14,13 +14,23 @@
description.value = event.target.innerText description.value = event.target.innerText
} }
onMounted(()=>{
loadCategory()
window.addEventListener('keydown', (event)=>{
if(event.ctrlKey === true){
if(event.key === 'l') {
description.value = categorySessions.value[0].description
}
}
})
})
const loadCategory = async () => { const loadCategory = async () => {
const response = await fetch(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'show-category/'+currentWorkingCategory.value.id) const response = await fetch(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'show-category/'+currentWorkingCategory.value.id)
categorySessions.value = await response.json() categorySessions.value = await response.json()
} }
onMounted(loadCategory)
watch(currentWorkingCategory, loadCategory) watch(currentWorkingCategory, loadCategory)
defineExpose({loadCategory}) defineExpose({loadCategory})
</script> </script>

Loading…
Cancel
Save