do not parse post emojis if post.emoji is undefined

This commit is contained in:
ari melody 2024-07-05 14:56:46 +01:00
parent abb06a40bc
commit 0d39ddd3d2
Signed by: ari
GPG key ID: CF99829C92678188

View file

@ -44,9 +44,11 @@ export async function parsePost(data, ancestor_count) {
post.visibility = data.visibility;
post.emojis = [];
if (post.emojis) {
data.emojis.forEach(emoji => {
post.emojis[emoji.shortcode] = parseEmoji(emoji.shortcode, emoji.url);
});
}
if (data.reactions) post.reactions = parseReactions(data.reactions);