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:
parent
c47452a8b4
commit
fae8b4e2e4
21 changed files with 181 additions and 118 deletions
|
@ -394,11 +394,11 @@ function removeSlot(eventChanges: ChangeRecord<Shift>[], shift: Shift, shiftSlot
|
|||
return eventChanges;
|
||||
}
|
||||
|
||||
const { data: session } = await useAccountSession();
|
||||
const sessionStore = useSessionStore();
|
||||
const schedule = await useSchedule();
|
||||
const runtimeConfig = useRuntimeConfig();
|
||||
const timezone = computed(
|
||||
() => session.value?.account?.timezone ?? runtimeConfig.public.defaultTimezone
|
||||
() => sessionStore.account?.timezone ?? runtimeConfig.public.defaultTimezone
|
||||
);
|
||||
|
||||
type ShiftSlotChange = { op: "set" | "del", data: ShiftSlot } ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue