From 40dc8912b710f344d07f8878e29c5e7ff782e0a4 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 8 May 2018 10:03:43 -0400 Subject: [PATCH] Fixed empty OpenGraph previews from trying to render an empty string (#1660) --- .../post_attachment_opengraph.js | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/app/components/post_attachment_opengraph/post_attachment_opengraph.js b/app/components/post_attachment_opengraph/post_attachment_opengraph.js index 19ae04baf..bf3cf8fd4 100644 --- a/app/components/post_attachment_opengraph/post_attachment_opengraph.js +++ b/app/components/post_attachment_opengraph/post_attachment_opengraph.js @@ -223,6 +223,21 @@ export default class PostAttachmentOpenGraph extends PureComponent { const style = getStyleSheet(theme); + let description = null; + if (openGraphData.description) { + description = ( + + + {openGraphData.description} + + + ); + } + return ( @@ -248,17 +263,7 @@ export default class PostAttachmentOpenGraph extends PureComponent { - {openGraphData.description && - - - {openGraphData.description} - - - } + {description} {hasImage &&