From 6490f4cf764a8a201b887f4bb91f1433762049f7 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 9ee1803459..6a8d9b78dd 100644 --- a/packages/client/src/components/sub-note-content.vue +++ b/packages/client/src/components/sub-note-content.vue @@ -1,5 +1,5 @@ @@ -31,11 +34,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);