mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-28 21:08:52 -07:00
[mastodon-client] Fix emoijs on status detail endpoint
This commit is contained in:
parent
6d2ed68a49
commit
5ee1a1e604
1 changed files with 3 additions and 3 deletions
|
@ -25,17 +25,17 @@ export class NoteConverter {
|
||||||
if (!await Notes.isVisibleForMe(note, user?.id ?? null))
|
if (!await Notes.isVisibleForMe(note, user?.id ?? null))
|
||||||
throw new Error('Cannot encode note not visible for user');
|
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)
|
const reactionEmojiNames = Object.keys(note.reactions)
|
||||||
.filter((x) => x?.startsWith(":"))
|
.filter((x) => x?.startsWith(":"))
|
||||||
.map((x) => decodeReaction(x).reaction)
|
.map((x) => decodeReaction(x).reaction)
|
||||||
.map((x) => x.replace(/:/g, ""));
|
.map((x) => x.replace(/:/g, ""));
|
||||||
|
|
||||||
const noteEmoji = populateEmojis(
|
const noteEmoji = Promise.resolve(host).then(async host => populateEmojis(
|
||||||
note.emojis.concat(reactionEmojiNames),
|
note.emojis.concat(reactionEmojiNames),
|
||||||
host,
|
host,
|
||||||
);
|
));
|
||||||
|
|
||||||
const reactionCount = NoteReactions.countBy({noteId: note.id});
|
const reactionCount = NoteReactions.countBy({noteId: note.id});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue