impr: replace amMod, amModOfAny, isAdmin, with profile class getters

This commit is contained in:
Xylight committed 2025-09-28 13:49:18 -07:00
1 parent e55d8abfa7
commit 8a217198ea
18 files changed
+89 -89

No files matched your search

+2 -3
View File
@@ -9,7 +9,6 @@ import { settings } from '$lib/app/settings.svelte'
import { theme, type ThemeData } from '$lib/app/theme/theme.svelte'
import { fullCommunityName } from '$lib/app/util.svelte'
import type { ResumableItem } from '$lib/feature/legacy/item'
import { amModOfAny, isAdmin } from '$lib/feature/moderation/moderation'
import {
ArrowRightOnRectangle,
ArrowTrendingDown,
@@ -92,7 +91,7 @@ export function getGroups(
name: t.get('nav.communities'),
icon: GlobeAlt,
},
...(amModOfAny(profile.user)
...(currentProfile.isMod()
? [
{
href: '/moderation',
@@ -101,7 +100,7 @@ export function getGroups(
},
]
: []),
...(profile.user && isAdmin(profile.user)
...(currentProfile.isAdmin
? [
{
href: '/admin',