From 6078c986d35b6c1bd560d532aa80073bb2e12d00 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Thu, 16 Jun 2022 12:51:44 +0200 Subject: [PATCH] fix: render empty note content correctly Instead of coercing to `null`, coercing to an empty string should simplify handling. --- packages/backend/src/remote/activitypub/renderer/note.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/remote/activitypub/renderer/note.ts b/packages/backend/src/remote/activitypub/renderer/note.ts index df2ae6520..b3bafaa3a 100644 --- a/packages/backend/src/remote/activitypub/renderer/note.ts +++ b/packages/backend/src/remote/activitypub/renderer/note.ts @@ -82,15 +82,14 @@ export default async function renderNote(note: Note, dive = true, isTalk = false const files = await getPromisedFiles(note.fileIds); - // text should never be undefined - const text = note.text ?? null; + const text = note.text ?? ''; let poll: Poll | null = null; if (note.hasPoll) { poll = await Polls.findOneBy({ noteId: note.id }); } - let apText = text ?? ''; + let apText = text; if (quote) { apText += `\n\nRE: ${quote}`;