summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/MkNote.vue
diff options
context:
space:
mode:
authorkabo2468 <28654659+kabo2468@users.noreply.github.com>2023-07-21 18:58:57 +0900
committerGitHub <noreply@github.com>2023-07-21 09:58:57 +0000
commita8cd8ed99ecd8b276ac2a08c03fc053419ca55ea (patch)
tree153a0738fa21f451aa7b889cc89ef9887d980e8c /packages/frontend/src/components/MkNote.vue
parentenhance: Add OGP data for notes with multiple images/videos (#11142) (diff)
downloadsharkey-a8cd8ed99ecd8b276ac2a08c03fc053419ca55ea.tar.gz
sharkey-a8cd8ed99ecd8b276ac2a08c03fc053419ca55ea.tar.bz2
sharkey-a8cd8ed99ecd8b276ac2a08c03fc053419ca55ea.zip
enhance: 自動でたたまれる機能が返信先や引用RNにも適用されるように (#10989)
* 返信、引用RNでMFMがあったら自動で隠すように * Update CHANGELOG.md * Update MkSubNoteContent.vue * refactor: avoid `Boolean` * docs: update CHANGELOG.md --------- Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Diffstat (limited to 'packages/frontend/src/components/MkNote.vue')
-rw-r--r--packages/frontend/src/components/MkNote.vue13
1 files changed, 2 insertions, 11 deletions
diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue
index 7a7406931b..deeae6e940 100644
--- a/packages/frontend/src/components/MkNote.vue
+++ b/packages/frontend/src/components/MkNote.vue
@@ -165,6 +165,7 @@ import { getNoteSummary } from '@/scripts/get-note-summary';
import { MenuItem } from '@/types/menu';
import MkRippleEffect from '@/components/MkRippleEffect.vue';
import { showMovedDialog } from '@/scripts/show-moved-dialog';
+import { shouldCollapsed } from '@/scripts/collapsed';
const props = defineProps<{
note: misskey.entities.Note;
@@ -204,17 +205,7 @@ let appearNote = $computed(() => isRenote ? note.renote as misskey.entities.Note
const isMyRenote = $i && ($i.id === note.userId);
const showContent = ref(false);
const urls = appearNote.text ? extractUrlFromMfm(mfm.parse(appearNote.text)) : null;
-const isLong = (appearNote.cw == null && appearNote.text != null && (
- (appearNote.text.includes('$[x2')) ||
- (appearNote.text.includes('$[x3')) ||
- (appearNote.text.includes('$[x4')) ||
- (appearNote.text.includes('$[scale')) ||
- (appearNote.text.includes('$[position')) ||
- (appearNote.text.split('\n').length > 9) ||
- (appearNote.text.length > 500) ||
- (appearNote.files.length >= 5) ||
- (urls && urls.length >= 4)
-));
+const isLong = shouldCollapsed(appearNote);
const collapsed = ref(appearNote.cw == null && isLong);
const isDeleted = ref(false);
const muted = ref(checkWordMute(appearNote, $i, defaultStore.state.mutedWords));