Reduce some more sentry errors (#5173)

* short-circuit user menu options if no user

* misc null checks
This commit is contained in:
Prospector
2026-01-20 15:58:45 -08:00
committed by GitHub
parent 4ed1a1ae7f
commit b36801c5ed
5 changed files with 30 additions and 27 deletions

View File

@@ -990,16 +990,19 @@ const navRoutes = computed(() => [
])
const userMenuOptions = computed(() => {
const user = auth.value.user
if (!user) return []
let options = [
{
id: 'profile',
link: `/user/${auth.value.user.username}`,
link: `/user/${user.username}`,
},
{
id: 'plus',
link: '/plus',
color: 'purple',
shown: !flags.value.hidePlusPromoInUserMenu && !isPermission(auth.value.user.badges, 1 << 0),
shown: !flags.value.hidePlusPromoInUserMenu && !isPermission(user.badges, 1 << 0),
},
{
id: 'servers',
@@ -1052,7 +1055,7 @@ const userMenuOptions = computed(() => {
{
id: 'affiliate-links',
link: '/dashboard/affiliate-links',
shown: auth.value.user.badges & UserBadge.AFFILIATE,
shown: user.badges & UserBadge.AFFILIATE,
},
{
id: 'revenue',