Merge pull request #3633 from tylershuster/oembed-improvements

landscape: better embed checking
This commit is contained in:
matildepark 2020-10-06 14:49:01 -04:00 committed by GitHub
commit 0436598a99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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}