Improve status.card normalization (it will never be a string)

This commit is contained in:
Alex Gleason 2022-03-31 14:27:44 -05:00
parent c4dd3c65f9
commit c077a4ea58
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 3 additions and 4 deletions

View file

@ -465,9 +465,8 @@ class Status extends ImmutablePureComponent<IStatus, IStatusState> {
);
} else if (size === 1 && firstAttachment.type === 'video') {
const video = firstAttachment;
const html = String(status.getIn(['card', 'html']));
if (video.external_video_id && html) {
if (video.external_video_id && status.card) {
const { mediaWrapperWidth } = this.state;
const getHeight = (): number => {
@ -484,7 +483,7 @@ class Status extends ImmutablePureComponent<IStatus, IStatusState> {
ref={this.setRef}
className='status-card__image status-card-video'
style={height ? { height } : undefined}
dangerouslySetInnerHTML={{ __html: html }}
dangerouslySetInnerHTML={{ __html: status.card.html }}
/>
</div>
);

View file

@ -25,7 +25,7 @@ export const StatusRecord = ImmutableRecord({
account: null as EmbeddedEntity<Account>,
application: null as ImmutableMap<string, any> | null,
bookmarked: false,
card: null as EmbeddedEntity<Card>,
card: null as Card | null,
content: '',
created_at: new Date(),
emojis: ImmutableList<Emoji>(),