Use a pinia store to manage account state
Refactor the existing scattered code dealing with the account state into a pinia store.
This commit is contained in:
parent
fae8b4e2e4
commit
e722876aae
12 changed files with 126 additions and 98 deletions
|
@ -5,13 +5,13 @@
|
|||
<li>
|
||||
<NuxtLink to="/schedule">View Schedule</NuxtLink>
|
||||
</li>
|
||||
<li v-if="sessionStore.account?.type === 'admin' || sessionStore.account?.type === 'crew'">
|
||||
<li v-if="accountStore.canEdit">
|
||||
<NuxtLink to="/edit">Edit Schedule</NuxtLink>
|
||||
</li>
|
||||
<li v-if="sessionStore.account">
|
||||
<li v-if="accountStore.valid">
|
||||
<NuxtLink to="/account/settings">Account Settings</NuxtLink>
|
||||
</li>
|
||||
<li v-if="!sessionStore.account">
|
||||
<li v-else>
|
||||
<NuxtLink to="/login">Log In / Create Account</NuxtLink>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -19,5 +19,5 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const sessionStore = useSessionStore();
|
||||
const accountStore = useAccountStore();
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue