Use a pinia store to manage session state

Replace the convoluted useAccountSession composable with a pinia store
that in addition allows for the consolidation of all session related
functions to grouped into one module.
This commit is contained in:
Hornwitser 2025-05-24 17:53:33 +02:00
parent c47452a8b4
commit fae8b4e2e4
21 changed files with 181 additions and 118 deletions

View file

@ -135,8 +135,8 @@ defineProps<{
}>();
const schedule = await useSchedule();
const { data: session } = await useAccountSession();
const canEditPublic = computed(() => session.value?.account.type === "admin");
const sessionStore = useSessionStore();
const canEditPublic = computed(() => sessionStore.account?.type === "admin");
function canEdit(event: ScheduleEvent) {
return event.crew || canEditPublic.value;