From fb88d08f882f192171a68a2270d067a4cb23d6c3 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 18 Apr 2019 09:43:31 -0300 Subject: [PATCH] [FIX] Apply emojify on empty texts (#824) --- app/containers/message/Markdown.js | 4 +++- app/containers/message/Reply.js | 2 +- app/views/RoomView/List.js | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/containers/message/Markdown.js b/app/containers/message/Markdown.js index 2fb12c765..db7b1910a 100644 --- a/app/containers/message/Markdown.js +++ b/app/containers/message/Markdown.js @@ -28,7 +28,9 @@ export default class Markdown extends React.Component { return null; } let m = formatText(msg); - m = emojify(m, { output: 'unicode' }); + if (m) { + m = emojify(m, { output: 'unicode' }); + } m = m.replace(/^\[([^\]]*)\]\(([^)]*)\)/, '').trim(); return ( { - if (!(attachment.author_icon || attachment.author_name || attachment.ts)) { + if (!attachment.author_name) { return null; } return ( diff --git a/app/views/RoomView/List.js b/app/views/RoomView/List.js index e5c16646e..37b062f96 100644 --- a/app/views/RoomView/List.js +++ b/app/views/RoomView/List.js @@ -123,7 +123,9 @@ export class List extends React.PureComponent { const thread = threads.find(t => t._id === item.tmid); if (thread) { let tmsg = thread.msg || (thread.attachments && thread.attachments.length && thread.attachments[0].title); - tmsg = emojify(tmsg, { output: 'unicode' }); + if (tmsg) { + tmsg = emojify(tmsg, { output: 'unicode' }); + } item = { ...item, tmsg }; } }