From 822c9f0d63678ca68a5231796c4c9f1c8fd2318d Mon Sep 17 00:00:00 2001 From: Freeplay Date: Wed, 21 Jun 2023 12:51:36 -0400 Subject: [PATCH] Fix show more button being shown when more than 4 images inside CW --- .../src/components/MkSubNoteContent.vue | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/client/src/components/MkSubNoteContent.vue b/packages/client/src/components/MkSubNoteContent.vue index ea1142e13..ab9c0a366 100644 --- a/packages/client/src/components/MkSubNoteContent.vue +++ b/packages/client/src/components/MkSubNoteContent.vue @@ -209,13 +209,19 @@ const emit = defineEmits<{ const cwButton = ref(); const showMoreButton = ref(); -const isLong = - !props.detailedView && - ((props.note.cw == null && - props.note.text != null && - (props.note.text.split("\n").length > 10 || - props.note.text.length > 800)) || - props.note.files.length > 4); + +const isLong = !props.detailedView && props.note.cw == null && + ( + ( + props.note.text != null && + ( + props.note.text.split("\n").length > 10 || + props.note.text.length > 800 + ) + ) || + props.note.files.length > 4 + ) +; const collapsed = $ref(props.note.cw == null && isLong);