summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/stream/channels/global-timeline.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-10-19 07:56:25 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-10-19 07:56:25 +0900
commitfcc48640800f6dcf4eb31d438609d00059b654bd (patch)
treedcca6fab8e2ce1a428fa9353e3d3b247fa9eb453 /packages/backend/src/server/api/stream/channels/global-timeline.ts
parentMerge branch 'develop' of https://github.com/misskey-dev/misskey into develop (diff)
downloadsharkey-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.ts6
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);