diff --git a/packages/backend/src/misc/get-note-summary.ts b/packages/backend/src/misc/get-note-summary.ts index 1a07139a50..5038106870 100644 --- a/packages/backend/src/misc/get-note-summary.ts +++ b/packages/backend/src/misc/get-note-summary.ts @@ -18,13 +18,15 @@ export const getNoteSummary = (note: Packed<'Note'>): string => { return '(⛔)'; } + if (note.cw != null) { + return `CW: ${note.cw}`; + } + let summary = ''; // 本文 - if (note.cw != null) { - summary += note.cw; - } else { - summary += note.text ? note.text : ''; + 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 6fd9947ac1..85903231a4 100644 --- a/packages/frontend/src/scripts/get-note-summary.ts +++ b/packages/frontend/src/scripts/get-note-summary.ts @@ -23,13 +23,15 @@ 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.cw != null) { - summary += note.cw; - } else { - summary += note.text ? note.text : ''; + if (note.text) { + summary += note.text; } // ファイルが添付されているとき