MM-10360 Render OpenGraph previews for pages with an empty description (#1651)

* MM-10360 Render OpenGraph previews for pages with an empty description

* Updated mattermost-redux
This commit is contained in:
Harrison Healey 2018-05-03 10:02:09 -04:00 committed by GitHub
parent 29d015bd32
commit 3b33b51f11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 12 deletions

View file

@ -217,7 +217,7 @@ export default class PostAttachmentOpenGraph extends PureComponent {
const {isReplyPost, openGraphData, theme} = this.props;
const {hasImage, height, imageUrl, width} = this.state;
if (!openGraphData || !openGraphData.description) {
if (!openGraphData || openGraphData.description == null) {
return null;
}
@ -248,15 +248,17 @@ export default class PostAttachmentOpenGraph extends PureComponent {
</Text>
</TouchableOpacity>
</View>
<View style={style.flex}>
<Text
style={style.siteDescription}
numberOfLines={5}
ellipsizeMode='tail'
>
{openGraphData.description}
</Text>
</View>
{openGraphData.description &&
<View style={style.flex}>
<Text
style={style.siteDescription}
numberOfLines={5}
ellipsizeMode='tail'
>
{openGraphData.description}
</Text>
</View>
}
{hasImage &&
<View ref='item'>
<TouchableWithoutFeedback

2
package-lock.json generated
View file

@ -9864,7 +9864,7 @@
}
},
"mattermost-redux": {
"version": "github:mattermost/mattermost-redux#c2cdd8fad33b97af4d0af2462b24f9cfd50a1913",
"version": "github:mattermost/mattermost-redux#6e347814cfefdd8ef3292fef2576ff8a0f082b58",
"requires": {
"deep-equal": "1.0.1",
"form-data": "2.3.1",

View file

@ -15,7 +15,7 @@
"fuse.js": "^3.2.0",
"intl": "1.2.5",
"jail-monkey": "1.0.0",
"mattermost-redux": "mattermost/mattermost-redux#c2cdd8fad33b97af4d0af2462b24f9cfd50a1913",
"mattermost-redux": "github:mattermost/mattermost-redux#6e347814cfefdd8ef3292fef2576ff8a0f082b58",
"prop-types": "15.6.1",
"react": "16.3.2",
"react-intl": "2.4.0",