diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx index 8faecdf..f001b70 100644 --- a/src/pages/Dashboard.tsx +++ b/src/pages/Dashboard.tsx @@ -8,9 +8,16 @@ import { useCurrentUser } from '@/hooks/useCurrentUser'; import { Card, CardContent } from '@/components/ui/card'; import { Alert, AlertDescription } from '@/components/ui/alert'; import { InfoIcon } from 'lucide-react'; +import { Account, useLoggedInAccounts } from '@/hooks/useLoggedInAccounts'; +import { genUserName } from '@/lib/genUserName'; export function Dashboard() { const { user } = useCurrentUser(); + const { currentUser } = useLoggedInAccounts(); + + const getDisplayName = (account: Account): string => { + return account.metadata.name ?? genUserName(account.pubkey); + } return ( @@ -40,7 +47,7 @@ export function Dashboard() { <>

- Welcome back! + Welcome back {currentUser ? getDisplayName(currentUser) : ''}!

Here's an overview of your Nostr activity and statistics.