perf(backend): reduce needless populateMyReaction calls
This commit is contained in:
parent
de6e15e36d
commit
fcc4864080
8 changed files with 29 additions and 15 deletions
|
@ -74,8 +74,10 @@ class HomeTimelineChannel 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue