From 802ad0fa02efcc00e47895aab716d4661ad7d711 Mon Sep 17 00:00:00 2001 From: Mar0xy Date: Sun, 1 Oct 2023 01:53:17 +0200 Subject: [PATCH] add: like button --- .../src/core/entities/NoteEntityService.ts | 7 ++- .../src/components/MkNoteDetailed.vue | 20 ++++++++ .../frontend/src/components/MkNoteSub.vue | 48 +++++++++++++++++-- 3 files changed, 66 insertions(+), 9 deletions(-) diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts index bcd99548fe..b3e140e588 100644 --- a/packages/backend/src/core/entities/NoteEntityService.ts +++ b/packages/backend/src/core/entities/NoteEntityService.ts @@ -343,6 +343,9 @@ export class NoteEntityService implements OnModuleInit { uri: note.uri ?? undefined, url: note.url ?? undefined, updatedAt: note.updatedAt != null ? note.updatedAt.toISOString() : undefined, + ...(meId ? { + myReaction: this.populateMyReaction(note, meId, options?._hint_), + } : {}), ...(opts.detail ? { clippedCount: note.clippedCount, @@ -358,10 +361,6 @@ export class NoteEntityService implements OnModuleInit { }) : undefined, poll: note.hasPoll ? this.populatePoll(note, meId) : undefined, - - ...(meId ? { - myReaction: this.populateMyReaction(note, meId, options?._hint_), - } : {}), } : {}), }); diff --git a/packages/frontend/src/components/MkNoteDetailed.vue b/packages/frontend/src/components/MkNoteDetailed.vue index ec7841c394..266721f95f 100644 --- a/packages/frontend/src/components/MkNoteDetailed.vue +++ b/packages/frontend/src/components/MkNoteDetailed.vue @@ -116,6 +116,9 @@ SPDX-License-Identifier: AGPL-3.0-only +