diff --git a/packages/backend/src/models/repositories/note-reaction.ts b/packages/backend/src/models/repositories/note-reaction.ts index 37b770e42..852cc4fa8 100644 --- a/packages/backend/src/models/repositories/note-reaction.ts +++ b/packages/backend/src/models/repositories/note-reaction.ts @@ -3,6 +3,7 @@ import { NoteReaction } from "@/models/entities/note-reaction.js"; import { Notes, Users } from "../index.js"; import type { Packed } from "@/misc/schema.js"; import type { User } from "@/models/entities/user.js"; +import { decodeReaction } from "@/misc/reaction-lib.js"; export const NoteReactionRepository = db.getRepository(NoteReaction).extend({ async pack( @@ -26,7 +27,7 @@ export const NoteReactionRepository = db.getRepository(NoteReaction).extend({ id: reaction.id, createdAt: reaction.createdAt.toISOString(), user: await Users.pack(reaction.user ?? reaction.userId, me), - type: reaction.reaction, + type: decodeReaction(reaction.reaction).reaction, ...(opts.withNote ? { note: await Notes.pack(reaction.note ?? reaction.noteId, me), diff --git a/packages/backend/src/models/repositories/note.ts b/packages/backend/src/models/repositories/note.ts index 75b8cac28..8fbcd86b1 100644 --- a/packages/backend/src/models/repositories/note.ts +++ b/packages/backend/src/models/repositories/note.ts @@ -73,7 +73,7 @@ async function populateMyReaction( if (_hint_?.myReactions) { const reaction = _hint_.myReactions.get(note.id); if (reaction) { - return reaction.reaction; + return decodeReaction(reaction.reaction).reaction; } else if (reaction === null) { return undefined; } @@ -86,7 +86,7 @@ async function populateMyReaction( }); if (reaction) { - return reaction.reaction; + return decodeReaction(reaction.reaction).reaction; } return undefined; @@ -103,7 +103,7 @@ export const NoteRepository = db.getRepository(Note).extend({ return true; } else { // 指定されているかどうか - return note.visibleUserIds.some((id: string) => meId === id); + return note.visibleUserIds.some((id: any) => meId === id); } }