summaryrefslogtreecommitdiff
path: root/packages/backend/src/misc/get-note-summary.ts
diff options
context:
space:
mode:
authorHazel K <acomputerdog@gmail.com>2024-10-01 18:26:59 -0400
committerHazel K <acomputerdog@gmail.com>2024-10-01 18:28:25 -0400
commitcb10fe91bb425f5e01e9c884fff824dea269705a (patch)
tree675726d7cdbbcddaa9663dab4a78a371a3d1523b /packages/backend/src/misc/get-note-summary.ts
parentavoid TS errors in get-note-summary (diff)
downloadsharkey-cb10fe91bb425f5e01e9c884fff824dea269705a.tar.gz
sharkey-cb10fe91bb425f5e01e9c884fff824dea269705a.tar.bz2
sharkey-cb10fe91bb425f5e01e9c884fff824dea269705a.zip
preserve non-text details in note summaries
Diffstat (limited to 'packages/backend/src/misc/get-note-summary.ts')
-rw-r--r--packages/backend/src/misc/get-note-summary.ts8
1 files changed, 3 insertions, 5 deletions
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;
}