Fixed horrible loading pattern for calendar

This commit is contained in:
Alexis
2024-08-24 14:01:16 +02:00
parent 23e996ee2e
commit 19a71d356e
6 changed files with 46 additions and 27 deletions

View File

@@ -8,11 +8,16 @@ import CenturyLayout from './state/centennially/Layout.vue'
import DecadeLayout from './state/decennially/Layout.vue'
import YearLayout from './state/yearly/Layout.vue'
const route = useRoute()
const id = route.params.id
const calendarStore = useCalendar()
import type { Calendar } from '~/models/CalendarConfig'
import type { Category } from '~/models/Category'
await calendarStore.fetchCalendar(Number(id))
const props = defineProps<{
calendarData: Calendar,
categories: Category[]
}>()
const { setActiveCalendar } = useCalendar()
setActiveCalendar(props.calendarData, props.categories)
const { currentConfig, jumpToDate, selectedDate } = useCalendar()