Better exception handling for getDomain
This commit is contained in:
parent
9efb046a06
commit
319890d138
5 changed files with 21 additions and 9 deletions
|
@ -12,7 +12,7 @@ import { Emojify } from './conversation/Emojify';
|
|||
import { StoryLinkPreview } from './StoryLinkPreview';
|
||||
import { TextAttachmentStyleType } from '../types/Attachment';
|
||||
import { count } from '../util/grapheme';
|
||||
import { getDomain } from '../types/LinkPreview';
|
||||
import { getSafeDomain } from '../types/LinkPreview';
|
||||
import { getFontNameByTextScript } from '../util/getFontNameByTextScript';
|
||||
import {
|
||||
COLOR_WHITE_INT,
|
||||
|
@ -295,7 +295,7 @@ export const TextAttachment = forwardRef<HTMLTextAreaElement, PropsType>(
|
|||
)}
|
||||
<StoryLinkPreview
|
||||
{...textAttachment.preview}
|
||||
domain={getDomain(String(textAttachment.preview.url))}
|
||||
domain={getSafeDomain(String(textAttachment.preview.url))}
|
||||
forceCompactMode={getTextSize(textContent) !== TextSize.Large}
|
||||
i18n={i18n}
|
||||
title={textAttachment.preview.title || undefined}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue