From: Anon Date: Sat, 25 Feb 2023 21:52:11 +0000 (-0600) Subject: Fix improper use of map X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/%22https:/hacktivis.me/%22?a=commitdiff_plain;h=f1147f5891e0f43b3f246c6ac64416be5d8ed7b8;p=lemmy-ui.git Fix improper use of map --- diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 9ca1b6d..f1f9c7f 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -621,7 +621,7 @@ export function setupTribute() { return `${item.original.val} ${shortName}`; }, selectTemplate: (item: any) => { - let customEmoji = customEmojisLookup[item.original.key]?.custom_emoji; + let customEmoji = customEmojisLookup.get(item.original.key)?.custom_emoji; if (customEmoji == undefined) return `${item.original.val}`; else @@ -722,7 +722,7 @@ export function updateEmojiDataModel(custom_emoji_view: CustomEmojiView) { customEmojis[categoryIndex].emojis[emojiIndex] = emoji; } } - customEmojisLookup[custom_emoji_view.custom_emoji.shortcode] = custom_emoji_view; + customEmojisLookup.set(custom_emoji_view.custom_emoji.shortcode,custom_emoji_view); } export function removeFromEmojiDataModel(id: number) {