Changed lazy fetch for reactive store data

This commit is contained in:
Alexis
2025-04-06 15:45:26 +02:00
parent b32fab81f6
commit aa76b17c37
3 changed files with 19 additions and 15 deletions

View File

@@ -36,6 +36,14 @@ watch(user, () => {
calRefresh()
catRefresh()
})
const { setActiveCalendar } = useCalendar()
watch(isLoading, (n) => {
if (!n && calendar.value?.data && categories.value?.data) {
setActiveCalendar(calendar.value?.data, categories.value.data)
}
}, { immediate: true }
)
</script>
<template>
@@ -57,7 +65,7 @@ watch(user, () => {
<Title>{{ calendar.data.name }}</Title>
</Head>
<Calendar :calendar-data="calendar.data" :categories="categories.data" />
<Calendar />
</div>
<div v-else class="h-full w-full grid place-items-center">