From 298febeb9c9501e3e3df16982c08657d1da474e0 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Mon, 15 Aug 2022 22:28:13 +0200 Subject: [PATCH] enhance: add re-collapsing to quoted notes --- .../src/components/sub-note-content.vue | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/packages/client/src/components/sub-note-content.vue b/packages/client/src/components/sub-note-content.vue index 46abc9c54..46907a729 100644 --- a/packages/client/src/components/sub-note-content.vue +++ b/packages/client/src/components/sub-note-content.vue @@ -1,5 +1,5 @@ @@ -30,11 +33,14 @@ const props = defineProps<{ note: misskey.entities.Note; }>(); -const collapsed = $ref( + +const isLong = ( props.note.cw == null && props.note.text != null && ( (props.note.text.split('\n').length > 9) || (props.note.text.length > 500) - )); + ) +); +const collapsed = $ref(props.note.cw == null && isLong);