fix: render empty note content correctly

Instead of coercing to `null`, coercing to an empty string should simplify handling.
This commit is contained in:
Johann150 2022-06-16 12:51:44 +02:00
parent b54f906605
commit 6078c986d3
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -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}`;