From 045de2fe980c7af19a351a9e147d2b5683f1fc10 Mon Sep 17 00:00:00 2001 From: ajdj100 Date: Sat, 17 Jan 2026 00:23:27 -0500 Subject: [PATCH] Fixed the join button not showing while logged out --- ui/src/components/Navigation/Navbar.vue | 28 +++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/ui/src/components/Navigation/Navbar.vue b/ui/src/components/Navigation/Navbar.vue index e454789..5a1399f 100644 --- a/ui/src/components/Navigation/Navbar.vue +++ b/ui/src/components/Navigation/Navbar.vue @@ -101,7 +101,7 @@ const navConfig: NavItem[] = [ { title: 'Join', to: '/join', - status: 'guest' + status: 'guest', }, ]; @@ -109,8 +109,27 @@ const filteredNav = computed(() => { return navConfig.flatMap(item => { const filtered: NavItem[] = []; - const shouldShow = (!item.status || item.status === auth.accountStatus.value) && - (!item.roles || auth.hasAnyRole(item.roles)); + // 1. Check Login Requirements + const isLoggedIn = userStore.isLoggedIn; + + // 2. Determine visibility based on status + let shouldShow = false; + + if (!item.status) { + // Public items - always show + shouldShow = true; + } else if (item.status === 'guest') { + // Show if NOT logged in OR logged in as guest (but NOT a member) + shouldShow = !isLoggedIn || auth.accountStatus.value === 'guest'; + } else if (item.status === 'member') { + // Show ONLY if logged in as member + shouldShow = isLoggedIn && auth.accountStatus.value === 'member'; + } + + // 3. Check Role Requirements (if status check passed) + if (shouldShow && item.roles) { + shouldShow = auth.hasAnyRole(item.roles); + } if (shouldShow) { if (item.items) { @@ -391,7 +410,8 @@ function mobileNavigateTo(to: string) { + @click="mobileNavigateTo('/join')">My + Application