Updated cloud mode checks.

This commit is contained in:
Mike Cao 2025-09-22 13:09:07 -07:00
parent d8075764e2
commit 9897c725de
16 changed files with 23 additions and 81 deletions

View file

@ -11,14 +11,13 @@ import {
Text,
Row,
} from '@umami/react-zen';
import { useMessages, useLoginQuery, useNavigation, useConfig } from '@/components/hooks';
import { useMessages, useLoginQuery, useNavigation } from '@/components/hooks';
import { LogOut, UserCircle, LockKeyhole } from '@/components/icons';
export function ProfileButton() {
const { formatMessage, labels } = useMessages();
const { user } = useLoginQuery();
const { renderUrl } = useNavigation();
const { cloudUrl } = useConfig();
const items = [
{
@ -28,7 +27,7 @@ export function ProfileButton() {
icon: <UserCircle />,
},
user.isAdmin &&
!cloudUrl && {
!process.env.cloudMode && {
id: 'admin',
label: formatMessage(labels.admin),
path: '/admin',