[mastodon-client] Fix note favorite status

This commit is contained in:
Laura Hausmann 2023-09-15 17:51:35 +02:00
parent 0aeeeca076
commit f906ec1d55
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -43,6 +43,8 @@ export class NoteConverter {
noteId: note.id,
}) : null;
const isFavorited = Promise.resolve(reaction).then(p => !!p);
const isReblogged = user ? Notes.exist({
where: {
userId: user.id,
@ -98,7 +100,7 @@ export class NoteConverter {
reblogs_count: note.renoteCount,
favourites_count: reactionCount,
reblogged: isReblogged,
favourited: !!reaction,
favourited: isFavorited,
muted: isMuted,
sensitive: files.then(files => files.length > 0 ? files.some((f) => f.isSensitive) : false),
spoiler_text: note.cw ? note.cw : "",