From 05898fbd9bf45b4c1a898e07ec192a4fc226007a Mon Sep 17 00:00:00 2001 From: Flycro Date: Thu, 21 Mar 2024 02:36:31 +0100 Subject: [PATCH] fix: Hopefully fix SSR in Navigation --- nuxt/components/Navigation.vue | 6 ++++-- nuxt/components/UserDropdown.vue | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/nuxt/components/Navigation.vue b/nuxt/components/Navigation.vue index 1480e99..00436c4 100644 --- a/nuxt/components/Navigation.vue +++ b/nuxt/components/Navigation.vue @@ -22,7 +22,9 @@ const links: NavigationTree[] = [ }, ] -/* if (authStore.user?.roles.includes('admin')) { +await useAsyncData('user', () => authStore.fetchUser()) + +if (authStore.user?.roles.includes('admin')) { links.push({ label: 'Admin', to: '/admin', @@ -40,7 +42,7 @@ const links: NavigationTree[] = [ }, ], }) -} */ +}