]> Untitled Git - lemmy-ui.git/commitdiff
Fix improper use of map
authorAnon <makotech222@gmail.com>
Sat, 25 Feb 2023 21:52:11 +0000 (15:52 -0600)
committerAnon <makotech222@gmail.com>
Sun, 26 Feb 2023 17:22:05 +0000 (11:22 -0600)
src/shared/utils.ts

index 9ca1b6d30eeb9c819d303693258a96b432785f14..f1f9c7f1d68302d58f46f8537bbae13fb5a2f09e 100644 (file)
@@ -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) {