diff --git a/src/components/show_category.vue b/src/components/show_category.vue index 800c559..09cbeca 100644 --- a/src/components/show_category.vue +++ b/src/components/show_category.vue @@ -14,13 +14,23 @@ 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 response = await fetch(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'show-category/'+currentWorkingCategory.value.id) categorySessions.value = await response.json() } - onMounted(loadCategory) - watch(currentWorkingCategory, loadCategory) defineExpose({loadCategory})