Update NoteEntityService.ts
This commit is contained in:
parent
9a986b3497
commit
9eb84c4ae2
|
@ -403,8 +403,8 @@ export class NoteEntityService implements OnModuleInit {
|
||||||
const myReactionsMap = new Map<MiNote['id'], MiNoteReaction | null>();
|
const myReactionsMap = new Map<MiNote['id'], MiNoteReaction | null>();
|
||||||
if (meId) {
|
if (meId) {
|
||||||
const renoteIds = notes.filter(n => n.renoteId != null).map(n => n.renoteId!);
|
const renoteIds = notes.filter(n => n.renoteId != null).map(n => n.renoteId!);
|
||||||
// パフォーマンスのためノートが作成されてから1秒以上経っていない場合はリアクションを取得しない
|
// パフォーマンスのためノートが作成されてから2秒以上経っていない場合はリアクションを取得しない
|
||||||
const targets = [...notes.filter(n => n.createdAt.getTime() + 1000 < Date.now()).map(n => n.id), ...renoteIds];
|
const targets = [...notes.filter(n => n.createdAt.getTime() + 2000 < Date.now()).map(n => n.id), ...renoteIds];
|
||||||
const myReactions = await this.noteReactionsRepository.findBy({
|
const myReactions = await this.noteReactionsRepository.findBy({
|
||||||
userId: meId,
|
userId: meId,
|
||||||
noteId: In(targets),
|
noteId: In(targets),
|
||||||
|
|
Loading…
Reference in New Issue