diff --git a/frontend/src/components/ChatHeader.tsx b/frontend/src/components/ChatHeader.tsx index 327663b..0631b78 100644 --- a/frontend/src/components/ChatHeader.tsx +++ b/frontend/src/components/ChatHeader.tsx @@ -94,15 +94,23 @@ export function ChatHeader({ onSetChannelFloodScopeOverride(conversation.id, nextValue); }; + const handleOpenConversationInfo = () => { + if (conversation.type === 'contact' && onOpenContactInfo) { + onOpenContactInfo(conversation.id); + return; + } + if (conversation.type === 'channel' && onOpenChannelInfo) { + onOpenChannelInfo(conversation.id); + } + }; + return (
{conversation.type === 'contact' && onOpenContactInfo && ( - onOpenContactInfo(conversation.id)} title="View contact info" aria-label={`View info for ${conversation.name}`} @@ -114,42 +122,41 @@ export function ChatHeader({ contactType={contacts.find((c) => c.public_key === conversation.id)?.type} clickable /> - + )} -

{ - if (conversation.type === 'contact' && onOpenContactInfo) { - onOpenContactInfo(conversation.id); - } else if (conversation.type === 'channel' && onOpenChannelInfo) { - onOpenChannelInfo(conversation.id); - } - } - : undefined - } - > - - {conversation.type === 'channel' && - !conversation.name.startsWith('#') && - activeChannel?.is_hashtag - ? '#' - : ''} - {conversation.name} - - {titleClickable && ( -