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
|
@ -5,13 +5,13 @@
|
|||
<li>
|
||||
<NuxtLink to="/schedule">View Schedule</NuxtLink>
|
||||
</li>
|
||||
<li v-if="session?.account?.type === 'admin' || session?.account?.type === 'crew'">
|
||||
<li v-if="sessionStore.account?.type === 'admin' || sessionStore.account?.type === 'crew'">
|
||||
<NuxtLink to="/edit">Edit Schedule</NuxtLink>
|
||||
</li>
|
||||
<li v-if="session">
|
||||
<li v-if="sessionStore.account">
|
||||
<NuxtLink to="/account/settings">Account Settings</NuxtLink>
|
||||
</li>
|
||||
<li v-if="!session">
|
||||
<li v-if="!sessionStore.account">
|
||||
<NuxtLink to="/login">Log In / Create Account</NuxtLink>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -19,5 +19,5 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const { data: session } = await useAccountSession();
|
||||
const sessionStore = useSessionStore();
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue