Adds mystery description fallback

If a message had no obvious text because it didn't have a content type
of post, use the mystery description as to not break the `postSnippet()`
function and give a valid snippet in the title.
This commit is contained in:
Nick Wynja 2020-05-12 09:33:28 -04:00
parent 8ce7d73edd
commit b4f0509e21
1 changed files with 1 additions and 1 deletions

View File

@ -711,7 +711,7 @@ exports.threadView = ({ messages }) => {
const rootMessage = messages[0];
const rootAuthorName = rootMessage.value.meta.author.name;
const rootSnippet = postSnippet(
lodash.get(rootMessage, "value.content.text")
lodash.get(rootMessage, "value.content.text", i18n.mysteryDescription)
);
return template([`@${rootAuthorName}: `, rootSnippet], thread(messages));
};