Composer: Fix paste text links (#6260)

This commit is contained in:
Alexander Zinchuk 2025-09-19 14:35:37 +02:00
parent 0d6388b3d9
commit 1a4aae6fef
2 changed files with 5 additions and 1 deletions

View File

@ -20,6 +20,8 @@ type OwnProps = {
chatId?: string; chatId?: string;
messageId?: number; messageId?: number;
threadId?: ThreadId; threadId?: ThreadId;
entityType?: ApiMessageEntityTypes.Url | ApiMessageEntityTypes.TextUrl |
`${ApiMessageEntityTypes.TextUrl}` | `${ApiMessageEntityTypes.Url}`;
}; };
const SafeLink = ({ const SafeLink = ({
@ -32,6 +34,7 @@ const SafeLink = ({
chatId, chatId,
messageId, messageId,
threadId, threadId,
entityType = ApiMessageEntityTypes.Url,
}: OwnProps) => { }: OwnProps) => {
const { openUrl } = getActions(); const { openUrl } = getActions();
@ -73,7 +76,7 @@ const SafeLink = ({
className={classNames} className={classNames}
onClick={handleClick} onClick={handleClick}
dir={isRtl ? 'rtl' : 'auto'} dir={isRtl ? 'rtl' : 'auto'}
data-entity-type={ApiMessageEntityTypes.Url} data-entity-type={entityType}
> >
{content} {content}
</a> </a>

View File

@ -619,6 +619,7 @@ function processEntity({
chatId={chatId} chatId={chatId}
messageId={messageId} messageId={messageId}
threadId={threadId} threadId={threadId}
entityType={entity.type}
> >
{renderNestedMessagePart()} {renderNestedMessagePart()}
</SafeLink> </SafeLink>