From 32aa78a614cf618f2f65e04b28aeaafd6d64e562 Mon Sep 17 00:00:00 2001 From: penginn-net <121443048+penginn-net@users.noreply.github.com> Date: Fri, 8 Nov 2024 14:00:41 +0900 Subject: [PATCH] fix --- packages/backend/src/core/ReactionService.ts | 22 ++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/backend/src/core/ReactionService.ts b/packages/backend/src/core/ReactionService.ts index bc892b6c9e..2c295dab31 100644 --- a/packages/backend/src/core/ReactionService.ts +++ b/packages/backend/src/core/ReactionService.ts @@ -179,16 +179,14 @@ export class ReactionService { // Create reaction try { await this.noteReactionsRepository.insert(record); - if (!(note.searchableBy === 'private' && note.userHost !== null)) { - await this.advancedSearchService.indexReaction({ - id: record.id, - noteId: record.noteId, - userId: record.userId, - reaction: record.reaction, - remote: user.host === null ? false : true, - searchableBy: note.searchableBy ?? undefined, - }); - } + await this.advancedSearchService.indexReaction({ + id: record.id, + noteId: record.noteId, + userId: record.userId, + reaction: record.reaction, + remote: user.host === null ? false : true, + searchableBy: note.searchableBy ?? undefined, + }); } catch (e) { if (isDuplicateKeyValueError(e)) { const exists = await this.noteReactionsRepository.findOneByOrFail({ @@ -311,9 +309,7 @@ export class ReactionService { // Delete reaction const result = await this.noteReactionsRepository.delete(exist.id); - if (note.searchableBy !== 'private') { - await this.advancedSearchService.unindexReaction(exist.id, user.host !== null, note.id, exist.reaction); - } + await this.advancedSearchService.unindexReaction(exist.id, user.host !== null, note.id, exist.reaction); if (result.affected !== 1) { throw new IdentifiableError('60527ec9-b4cb-4a88-a6bd-32d3ad26817d', 'not reacted');