Merge pull request 'Upkeep: Fix errors regarding emojis in the mastodon instance info compatability endpoint.' (#9348) from legiayayana/calckey:legiayayana/fix-missing-emotes-crash into develop

Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9348
This commit is contained in:
Kainoa Kanter 2022-12-29 10:04:46 +00:00
commit 7c2087dc4b

View File

@ -181,10 +181,10 @@ const getContact = async (
following_count: user.followingCount,
statuses_count: user.notesCount,
last_status_at: user.lastActiveDate?.toISOString(),
emojis: emojis ? user.emojis.map(e => ({
emojis: emojis ? user.emojis.filter((e, i, a) => e in emojis && a.indexOf(e) == i).map(e => ({
shortcode: e,
static_url: `${config.url}/files/${emojis[e].publicUrl}`,
url: `${config.url}/files/${emojis[e].publicUrl}`,
static_url: emojis[e].publicUrl,
url: emojis[e].originalUrl,
visible_in_picker: true,
})) : [],
};