diff options
| author | Johann150 <johann.galle@protonmail.com> | 2022-06-16 12:51:44 +0200 |
|---|---|---|
| committer | Johann150 <johann.galle@protonmail.com> | 2022-06-16 12:51:44 +0200 |
| commit | 6078c986d35b6c1bd560d532aa80073bb2e12d00 (patch) | |
| tree | c6563f2a1f92494158229b7ebb162a47c6d8f4fb /packages/backend/src/remote | |
| parent | fix: correctly render note text (diff) | |
| download | sharkey-6078c986d35b6c1bd560d532aa80073bb2e12d00.tar.gz sharkey-6078c986d35b6c1bd560d532aa80073bb2e12d00.tar.bz2 sharkey-6078c986d35b6c1bd560d532aa80073bb2e12d00.zip | |
fix: render empty note content correctly
Instead of coercing to `null`, coercing to an empty string should simplify handling.
Diffstat (limited to 'packages/backend/src/remote')
| -rw-r--r-- | packages/backend/src/remote/activitypub/renderer/note.ts | 5 |
1 files 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 df2ae65205..b3bafaa3ab 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}`; |