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

index 02009249052277e5e621439c426eef3ee00ad68a..9ca1b6d30eeb9c819d303693258a96b432785f14 100644 (file)
@@ -630,7 +630,7 @@ export function setupTribute() {
         values: Object.entries(emojiShortName).map(e => {
           return { key: e[1], val: e[0] };
         }).concat(
-          Object.entries(customEmojisLookup).map((k) => ({
+          Array.from(customEmojisLookup.entries()).map((k) => ({
             key: k[0],
             val: `<img class="icon icon-emoji" src="${k[1].custom_emoji.image_url}" title="${k[1].custom_emoji.shortcode}" alt="${k[1].custom_emoji.alt_text}" />`
           }))
@@ -749,7 +749,7 @@ function setupMarkdown() {
     typographer: true,
   };
 
-  const emojiDefs = Object.fromEntries(Object.entries(customEmojisLookup).map((k) => [k[0], k[0]]));
+  const emojiDefs = Array.from(customEmojisLookup.entries()).reduce((main, [key, value]) => ({...main, [key]: value}), {})
   md = new MarkdownIt(markdownItConfig)
     .use(markdown_it_sub)
     .use(markdown_it_sup)