Improve status.card normalization (it will never be a string)
This commit is contained in:
parent
c4dd3c65f9
commit
c077a4ea58
|
@ -465,9 +465,8 @@ class Status extends ImmutablePureComponent<IStatus, IStatusState> {
|
||||||
);
|
);
|
||||||
} else if (size === 1 && firstAttachment.type === 'video') {
|
} else if (size === 1 && firstAttachment.type === 'video') {
|
||||||
const video = firstAttachment;
|
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 { mediaWrapperWidth } = this.state;
|
||||||
|
|
||||||
const getHeight = (): number => {
|
const getHeight = (): number => {
|
||||||
|
@ -484,7 +483,7 @@ class Status extends ImmutablePureComponent<IStatus, IStatusState> {
|
||||||
ref={this.setRef}
|
ref={this.setRef}
|
||||||
className='status-card__image status-card-video'
|
className='status-card__image status-card-video'
|
||||||
style={height ? { height } : undefined}
|
style={height ? { height } : undefined}
|
||||||
dangerouslySetInnerHTML={{ __html: html }}
|
dangerouslySetInnerHTML={{ __html: status.card.html }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -25,7 +25,7 @@ export const StatusRecord = ImmutableRecord({
|
||||||
account: null as EmbeddedEntity<Account>,
|
account: null as EmbeddedEntity<Account>,
|
||||||
application: null as ImmutableMap<string, any> | null,
|
application: null as ImmutableMap<string, any> | null,
|
||||||
bookmarked: false,
|
bookmarked: false,
|
||||||
card: null as EmbeddedEntity<Card>,
|
card: null as Card | null,
|
||||||
content: '',
|
content: '',
|
||||||
created_at: new Date(),
|
created_at: new Date(),
|
||||||
emojis: ImmutableList<Emoji>(),
|
emojis: ImmutableList<Emoji>(),
|
||||||
|
|
Loading…
Reference in New Issue