landscape: better embed checking

This commit is contained in:
Tyler Brown Cifu Shuster 2020-10-01 21:02:58 -07:00
parent 77b1db2d16
commit 47c746457e

View File

@ -139,14 +139,14 @@ export default class RemoteContent extends PureComponent<RemoteContentProps, Rem
</>
);
} else if (isOembed && remoteContentPolicy.oembedShown) {
if (!this.state.embed) {
if (!this.state.embed || this.state.embed?.html === '') {
this.loadOembed();
}
return (
<Fragment>
{renderUrl ? this.wrapInLink(this.state.embed && this.state.embed.title ? this.state.embed.title : url) : null}
{this.state.embed !== 'error' && !unfold ? <Button
{this.state.embed !== 'error' && this.state.embed?.html && !unfold ? <Button
border={1}
style={{ display: 'inline-flex', height: '1.66em' }} // Height is hacked to line-height until Button supports proper size
ml={1}