From 5ee1a1e6044efd4f78fbaed03bf40cbd6419eb70 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sun, 24 Sep 2023 22:19:02 +0200 Subject: [PATCH] [mastodon-client] Fix emoijs on status detail endpoint --- packages/backend/src/server/api/mastodon/converters/note.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/converters/note.ts b/packages/backend/src/server/api/mastodon/converters/note.ts index b38190d73..e3c790e6d 100644 --- a/packages/backend/src/server/api/mastodon/converters/note.ts +++ b/packages/backend/src/server/api/mastodon/converters/note.ts @@ -25,17 +25,17 @@ export class NoteConverter { if (!await Notes.isVisibleForMe(note, user?.id ?? null)) throw new Error('Cannot encode note not visible for user'); - const host = note.user?.host ?? null; + const host = Promise.resolve(noteUser).then(noteUser => noteUser.host ?? null); const reactionEmojiNames = Object.keys(note.reactions) .filter((x) => x?.startsWith(":")) .map((x) => decodeReaction(x).reaction) .map((x) => x.replace(/:/g, "")); - const noteEmoji = populateEmojis( + const noteEmoji = Promise.resolve(host).then(async host => populateEmojis( note.emojis.concat(reactionEmojiNames), host, - ); + )); const reactionCount = NoteReactions.countBy({noteId: note.id});