Fixed empty OpenGraph previews from trying to render an empty string (#1660)
This commit is contained in:
parent
0559262b12
commit
40dc8912b7
1 changed files with 16 additions and 11 deletions
|
|
@ -223,6 +223,21 @@ export default class PostAttachmentOpenGraph extends PureComponent {
|
|||
|
||||
const style = getStyleSheet(theme);
|
||||
|
||||
let description = null;
|
||||
if (openGraphData.description) {
|
||||
description = (
|
||||
<View style={style.flex}>
|
||||
<Text
|
||||
style={style.siteDescription}
|
||||
numberOfLines={5}
|
||||
ellipsizeMode='tail'
|
||||
>
|
||||
{openGraphData.description}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<View style={style.container}>
|
||||
<View style={style.flex}>
|
||||
|
|
@ -248,17 +263,7 @@ export default class PostAttachmentOpenGraph extends PureComponent {
|
|||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
{openGraphData.description &&
|
||||
<View style={style.flex}>
|
||||
<Text
|
||||
style={style.siteDescription}
|
||||
numberOfLines={5}
|
||||
ellipsizeMode='tail'
|
||||
>
|
||||
{openGraphData.description}
|
||||
</Text>
|
||||
</View>
|
||||
}
|
||||
{description}
|
||||
{hasImage &&
|
||||
<View ref='item'>
|
||||
<TouchableWithoutFeedback
|
||||
|
|
|
|||
Loading…
Reference in a new issue