fix: decrement of renotecount
This commit is contained in:
parent
a8d937b08e
commit
85f3534b2c
1 changed files with 5 additions and 2 deletions
|
@ -68,8 +68,11 @@ export class NoteDeleteService {
|
||||||
await this.notesRepository.decrement({ id: note.replyId }, 'repliesCount', 1);
|
await this.notesRepository.decrement({ id: note.replyId }, 'repliesCount', 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (note.renoteId && note.renote?.renoteCount !== 0 && note.renote?.userId !== user.id && note.text == null && !note.hasPoll && (note.fileIds == null || note.fileIds.length === 0)) {
|
if (note.renoteId && note.text == null && !note.hasPoll && (note.fileIds == null || note.fileIds.length === 0)) {
|
||||||
await this.notesRepository.decrement({ id: note.renoteId }, 'renoteCount', 1);
|
await this.notesRepository.findOneBy({ id: note.renoteId }).then(async (renote) => {
|
||||||
|
if (!renote) return;
|
||||||
|
if (renote.userId !== user.id) await this.notesRepository.decrement({ id: renote.id }, 'renoteCount', 1);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!quiet) {
|
if (!quiet) {
|
||||||
|
|
Loading…
Reference in a new issue