diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-10-19 07:56:25 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-10-19 07:56:25 +0900 |
| commit | fcc48640800f6dcf4eb31d438609d00059b654bd (patch) | |
| tree | dcca6fab8e2ce1a428fa9353e3d3b247fa9eb453 /packages/backend/src/server/api/stream/channels/global-timeline.ts | |
| parent | Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop (diff) | |
| download | sharkey-fcc48640800f6dcf4eb31d438609d00059b654bd.tar.gz sharkey-fcc48640800f6dcf4eb31d438609d00059b654bd.tar.bz2 sharkey-fcc48640800f6dcf4eb31d438609d00059b654bd.zip | |
perf(backend): reduce needless populateMyReaction calls
Diffstat (limited to 'packages/backend/src/server/api/stream/channels/global-timeline.ts')
| -rw-r--r-- | packages/backend/src/server/api/stream/channels/global-timeline.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/backend/src/server/api/stream/channels/global-timeline.ts b/packages/backend/src/server/api/stream/channels/global-timeline.ts index c499d1787e..9c623abf76 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -72,8 +72,10 @@ class GlobalTimelineChannel extends Channel { if (note.renote && !note.text && isUserRelated(note, this.userIdsWhoMeMutingRenotes)) return; if (this.user && note.renoteId && !note.text) { - const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renoteId, this.user.id); - note.renote!.myReaction = myRenoteReaction; + if (note.renote && Object.keys(note.renote.reactions).length > 0) { + const myRenoteReaction = await this.noteEntityService.populateMyReaction(note.renoteId, this.user.id); + note.renote!.myReaction = myRenoteReaction; + } } this.connection.cacheNote(note); |