summaryrefslogtreecommitdiff
path: root/packages/backend/src/misc/get-note-summary.ts
diff options
context:
space:
mode:
authorHazel K <acomputerdog@gmail.com>2024-10-01 14:44:16 -0400
committerHazel K <acomputerdog@gmail.com>2024-10-01 14:47:06 -0400
commit34aeeb0862da152b91ea3496c199cf1de631d570 (patch)
tree596ec38066498a39b1ff3e9c93b4c410850524da /packages/backend/src/misc/get-note-summary.ts
parentmerge: Merge stable into develop (!636) (diff)
downloadsharkey-34aeeb0862da152b91ea3496c199cf1de631d570.tar.gz
sharkey-34aeeb0862da152b91ea3496c199cf1de631d570.tar.bz2
sharkey-34aeeb0862da152b91ea3496c199cf1de631d570.zip
respect CWs in note summaries
Diffstat (limited to 'packages/backend/src/misc/get-note-summary.ts')
-rw-r--r--packages/backend/src/misc/get-note-summary.ts10
1 files changed, 6 insertions, 4 deletions
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;
}
// ファイルが添付されているとき