fix noteClickToOpen in MkSub

This commit is contained in:
fly_mc 2024-10-19 23:38:40 +08:00
parent 37491881fd
commit 91b3a27e02

View file

@ -36,11 +36,22 @@ import MkMediaList from '@/components/MkMediaList.vue';
import MkPoll from '@/components/MkPoll.vue'; import MkPoll from '@/components/MkPoll.vue';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { shouldCollapsed } from '@@/js/collapsed.js'; import { shouldCollapsed } from '@@/js/collapsed.js';
import { defaultStore } from '@/store.js';
import { useRouter } from '@/router/supplier.js';
const props = defineProps<{ const props = defineProps<{
note: Misskey.entities.Note; 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 isLong = shouldCollapsed(props.note, []);
const collapsed = ref(isLong); const collapsed = ref(isLong);