summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/entities
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-05-05 10:50:58 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-05-08 16:20:29 -0400
commit5e2cc8eb855157f01d67d45e751837aaebffe65c (patch)
treea572554d1ae7d2c3e81cd7aaca9fa262c7b99458 /packages/backend/src/core/entities
parentdon't insert mentions for the current user (diff)
downloadsharkey-5e2cc8eb855157f01d67d45e751837aaebffe65c.tar.gz
sharkey-5e2cc8eb855157f01d67d45e751837aaebffe65c.tar.bz2
sharkey-5e2cc8eb855157f01d67d45e751837aaebffe65c.zip
avoid error when editing notes without any mentions
Diffstat (limited to 'packages/backend/src/core/entities')
-rw-r--r--packages/backend/src/core/entities/NoteEntityService.ts5
1 files changed, 1 insertions, 4 deletions
diff --git a/packages/backend/src/core/entities/NoteEntityService.ts b/packages/backend/src/core/entities/NoteEntityService.ts
index 94fe9e97ef..45d9491e36 100644
--- a/packages/backend/src/core/entities/NoteEntityService.ts
+++ b/packages/backend/src/core/entities/NoteEntityService.ts
@@ -444,9 +444,6 @@ export class NoteEntityService implements OnModuleInit {
const packedFiles = options?._hint_?.packedFiles;
const packedUsers = options?._hint_?.packedUsers;
- // Do not await - defer until the awaitAll below
- const mentionHandles = this.getUserHandles(note.mentions, options?._hint_?.mentionHandles);
-
const packed: Packed<'Note'> = await awaitAll({
id: note.id,
createdAt: this.idService.parse(note.id).date.toISOString(),
@@ -481,7 +478,7 @@ export class NoteEntityService implements OnModuleInit {
userId: channel.userId,
} : undefined,
mentions: note.mentions.length > 0 ? note.mentions : undefined,
- mentionHandles: note.mentions.length > 0 ? mentionHandles : undefined,
+ mentionHandles: note.mentions.length > 0 ? this.getUserHandles(note.mentions, options?._hint_?.mentionHandles) : undefined,
uri: note.uri ?? undefined,
url: note.url ?? undefined,
poll: note.hasPoll ? this.populatePoll(note, meId) : undefined,