From 3d0b754332192533b166f8aa20ec87f1808edfe8 Mon Sep 17 00:00:00 2001
From: Mar0xy <marie@kaifa.ch>
Date: Mon, 27 Nov 2023 22:06:25 +0100
Subject: fix: selecting text in a note causing it to open

Closes transfem-org/Sharkey#175
---
 packages/frontend/src/components/MkSubNoteContent.vue | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'packages/frontend/src/components/MkSubNoteContent.vue')

diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue
index 110644947f..8a306d172f 100644
--- a/packages/frontend/src/components/MkSubNoteContent.vue
+++ b/packages/frontend/src/components/MkSubNoteContent.vue
@@ -16,7 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 			<MkLoading v-if="translating" mini/>
 			<div v-else>
 				<b>{{ i18n.t('translatedFrom', { x: translation.sourceLang }) }}: </b>
-				<Mfm :text="translation.text" :author="note.user" :nyaize="'account'" :emojiUrls="note.emojis"/>
+				<Mfm :text="translation.text" :author="note.user" :nyaize="'respect'" :emojiUrls="note.emojis"/>
 			</div>
 		</div>
 		<MkA v-if="note.renoteId" :class="$style.rp" :to="`/notes/${note.renoteId}`" v-on:click.stop>RN: ...</MkA>
@@ -63,7 +63,10 @@ const props = defineProps<{
 const router = useRouter();
 
 function noteclick(id: string) {
-	router.push(`/notes/${id}`);
+	const selection = document.getSelection();
+	if (selection?.toString().length === 0) {
+		router.push(`/notes/${id}`);
+	}
 }
 
 const parsed = $computed(() => props.note.text ? mfm.parse(props.note.text) : null);
-- 
cgit v1.2.3-freya

