mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 08:53:48 +01:00
[mastodon-client] Fix emoijs on status detail endpoint
This commit is contained in:
parent
6d2ed68a49
commit
5ee1a1e604
@ -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 New Issue
Block a user