[FIX] Apply emojify on empty texts (#824)
This commit is contained in:
parent
fde8aea173
commit
fb88d08f88
|
@ -28,7 +28,9 @@ export default class Markdown extends React.Component {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
let m = formatText(msg);
|
let m = formatText(msg);
|
||||||
|
if (m) {
|
||||||
m = emojify(m, { output: 'unicode' });
|
m = emojify(m, { output: 'unicode' });
|
||||||
|
}
|
||||||
m = m.replace(/^\[([^\]]*)\]\(([^)]*)\)/, '').trim();
|
m = m.replace(/^\[([^\]]*)\]\(([^)]*)\)/, '').trim();
|
||||||
return (
|
return (
|
||||||
<MarkdownRenderer
|
<MarkdownRenderer
|
||||||
|
|
|
@ -97,7 +97,7 @@ const Reply = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderTitle = () => {
|
const renderTitle = () => {
|
||||||
if (!(attachment.author_icon || attachment.author_name || attachment.ts)) {
|
if (!attachment.author_name) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -123,7 +123,9 @@ export class List extends React.PureComponent {
|
||||||
const thread = threads.find(t => t._id === item.tmid);
|
const thread = threads.find(t => t._id === item.tmid);
|
||||||
if (thread) {
|
if (thread) {
|
||||||
let tmsg = thread.msg || (thread.attachments && thread.attachments.length && thread.attachments[0].title);
|
let tmsg = thread.msg || (thread.attachments && thread.attachments.length && thread.attachments[0].title);
|
||||||
|
if (tmsg) {
|
||||||
tmsg = emojify(tmsg, { output: 'unicode' });
|
tmsg = emojify(tmsg, { output: 'unicode' });
|
||||||
|
}
|
||||||
item = { ...item, tmsg };
|
item = { ...item, tmsg };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue