avoid error when editing notes without any mentions

This commit is contained in:
Hazelnoot 2025-05-05 10:50:58 -04:00
parent d06e1e3080
commit 5e2cc8eb85

View file

@ -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,