mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-09-14 06:42:25 +03:00
Fix room mention (#1459)
* create room mention with alias if possible * display room mention text as they were sent
This commit is contained in:
parent
ed3d14b131
commit
a2692e1469
3 changed files with 10 additions and 11 deletions
|
@ -180,10 +180,7 @@ export const getReactCustomHtmlParser = (
|
|||
mentionPrefix === '#'
|
||||
? getRoomWithCanonicalAlias(mx, mentionId)
|
||||
: mx.getRoom(mentionId);
|
||||
const mentionName = mentionRoom?.name;
|
||||
|
||||
const mentionDisplayName =
|
||||
mentionName && (mentionName.startsWith('#') ? mentionName : `#${mentionName}`);
|
||||
return (
|
||||
<span
|
||||
{...props}
|
||||
|
@ -198,7 +195,7 @@ export const getReactCustomHtmlParser = (
|
|||
onClick={params.handleMentionClick}
|
||||
style={{ cursor: 'pointer' }}
|
||||
>
|
||||
{mentionDisplayName ?? mentionId}
|
||||
{domToReact(children, opts)}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue