Skip to content
Snippets Groups Projects
Unverified Commit 6078c986 authored by Johann150's avatar Johann150
Browse files

fix: render empty note content correctly

Instead of coercing to `null`, coercing to an empty string should simplify handling.
parent b54f9066
No related branches found
No related tags found
No related merge requests found
...@@ -82,15 +82,14 @@ export default async function renderNote(note: Note, dive = true, isTalk = false ...@@ -82,15 +82,14 @@ export default async function renderNote(note: Note, dive = true, isTalk = false
const files = await getPromisedFiles(note.fileIds); const files = await getPromisedFiles(note.fileIds);
// text should never be undefined const text = note.text ?? '';
const text = note.text ?? null;
let poll: Poll | null = null; let poll: Poll | null = null;
if (note.hasPoll) { if (note.hasPoll) {
poll = await Polls.findOneBy({ noteId: note.id }); poll = await Polls.findOneBy({ noteId: note.id });
} }
let apText = text ?? ''; let apText = text;
if (quote) { if (quote) {
apText += `\n\nRE: ${quote}`; apText += `\n\nRE: ${quote}`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment