diff --git a/packages/backend/src/misc/get-note-summary.ts b/packages/backend/src/misc/get-note-summary.ts index 58938d3b32..2652294103 100644 --- a/packages/backend/src/misc/get-note-summary.ts +++ b/packages/backend/src/misc/get-note-summary.ts @@ -18,14 +18,12 @@ export const getNoteSummary = (note: Packed<'Note'>): string => { return '(⛔)'; } - if (note.cw != null) { - return `CW: ${note.cw}`; - } - let summary = ''; // 本文 - if (note.text) { + if (note.cw != null) { + summary += `CW: ${note.cw}`; + } else if (note.text) { summary += note.text; } diff --git a/packages/frontend/src/scripts/get-note-summary.ts b/packages/frontend/src/scripts/get-note-summary.ts index d695b3a062..6c70ced67f 100644 --- a/packages/frontend/src/scripts/get-note-summary.ts +++ b/packages/frontend/src/scripts/get-note-summary.ts @@ -23,14 +23,12 @@ export const getNoteSummary = (note?: Misskey.entities.Note | null): string => { return `(${i18n.ts.invisibleNote})`; } - if (note.cw != null) { - return `CW: ${note.cw}`; - } - let summary = ''; // 本文 - if (note.text) { + if (note.cw != null) { + summary += `CW: ${note.cw}`; + } else if (note.text) { summary += note.text; }