From 91b3a27e02d52325b5eeb09fc8d5c76b1ee45e45 Mon Sep 17 00:00:00 2001 From: fly_mc Date: Sat, 19 Oct 2024 23:38:40 +0800 Subject: [PATCH] fix noteClickToOpen in MkSub --- packages/frontend/src/components/MkSubNoteContent.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue index 2e9839f74..c01cf0e35 100644 --- a/packages/frontend/src/components/MkSubNoteContent.vue +++ b/packages/frontend/src/components/MkSubNoteContent.vue @@ -36,11 +36,22 @@ import MkMediaList from '@/components/MkMediaList.vue'; import MkPoll from '@/components/MkPoll.vue'; import { i18n } from '@/i18n.js'; import { shouldCollapsed } from '@@/js/collapsed.js'; +import { defaultStore } from '@/store.js'; +import { useRouter } from '@/router/supplier.js'; const props = defineProps<{ note: Misskey.entities.Note; }>(); +const router = useRouter(); + +function noteClickToOpen(id: string) { + const selection = document.getSelection(); + if (selection?.toString().length === 0) { + router.push(`/notes/${id}`); + } +} + const isLong = shouldCollapsed(props.note, []); const collapsed = ref(isLong);