mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-25 15:35:12 +00:00
fix: render empty note content correctly
Instead of coercing to `null`, coercing to an empty string should simplify handling.
This commit is contained in:
parent
b54f906605
commit
6078c986d3
1 changed files with 2 additions and 3 deletions
|
@ -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}`;
|
||||||
|
|
Loading…
Reference in a new issue