diff options
| author | Mar0xy <marie@kaifa.ch> | 2023-10-15 18:16:41 +0200 |
|---|---|---|
| committer | Mar0xy <marie@kaifa.ch> | 2023-10-15 18:16:41 +0200 |
| commit | 97df169ebec769d98330d2df4b95471055cbe9bc (patch) | |
| tree | 2a0564cdb394d478840fe13cdf701c9ba9bc4cb2 /packages/backend/src/core | |
| parent | fix: prevent quoted toast to be triggered when not quoted (diff) | |
| download | sharkey-97df169ebec769d98330d2df4b95471055cbe9bc.tar.gz sharkey-97df169ebec769d98330d2df4b95471055cbe9bc.tar.bz2 sharkey-97df169ebec769d98330d2df4b95471055cbe9bc.zip | |
fix: don't decrement past 0
Diffstat (limited to 'packages/backend/src/core')
| -rw-r--r-- | packages/backend/src/core/NoteDeleteService.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/backend/src/core/NoteDeleteService.ts b/packages/backend/src/core/NoteDeleteService.ts index f6a9232b3a..33e39ec8b5 100644 --- a/packages/backend/src/core/NoteDeleteService.ts +++ b/packages/backend/src/core/NoteDeleteService.ts @@ -68,7 +68,7 @@ export class NoteDeleteService { await this.notesRepository.decrement({ id: note.replyId }, 'repliesCount', 1); } - if (note.renoteId && note.renote?.userId !== user.id && note.text == null && !note.hasPoll && (note.fileIds == null || note.fileIds.length === 0)) { + if (note.renoteId && note.renote?.renoteCount !== 0 && note.renote?.userId !== user.id && note.text == null && !note.hasPoll && (note.fileIds == null || note.fileIds.length === 0)) { await this.notesRepository.decrement({ id: note.renoteId }, 'renoteCount', 1); } |