Refactored the store system

This commit is contained in:
Alexis
2024-08-20 09:15:05 +02:00
parent 7244120219
commit e978acfc71
26 changed files with 446 additions and 240 deletions

View File

@@ -13,8 +13,14 @@ watch(user, (n, _o) => {
navigateTo('/')
}
})
const route = useRoute()
const id = route.params.id
const calendarStore = useCalendar()
const { pending: calendarPending } = await useAsyncData('calendar', () => calendarStore.fetchCalendar(Number(id)).then(() => true))
</script>
<template>
<Calendar />
<Calendar v-if="!calendarPending" />
</template>

View File

@@ -20,9 +20,6 @@ watch(user, (n, _o) => {
navigateTo('/')
}
})
const { setCurrentMenu } = useUiStore()
setCurrentMenu([])
</script>
<template>

View File

@@ -25,9 +25,6 @@ watch(user, (n, _o) => {
}
})
const { setCurrentMenu } = useUiStore()
setCurrentMenu([])
const modalOpened = ref<boolean>(false)
</script>
@@ -69,7 +66,7 @@ const modalOpened = ref<boolean>(false)
<UiCard
v-if="calendar"
class="w-full transition-all text-slate-100 bg-slate-900 border-slate-700 hover:bg-slate-700 dark:hover:bg-slate-800 dark:border-slate-900 dark:focus-within:outline-slate-900"
:link="`/i/world/${world.id}/calendar`"
:link="`/i/calendar/${calendar.id}`"
>
<UiCardHeader>
<UiCardTitle>{{ calendar.name }}</UiCardTitle>

View File

@@ -2,9 +2,6 @@
useHead({
title: 'Dashboard'
})
const { setCurrentMenu } = useUiStore()
setCurrentMenu([])
</script>
<template>