fix: selecting text in a note causing it to open

Closes transfem-org/Sharkey#175
This commit is contained in:
Mar0xy 2023-11-27 22:06:25 +01:00
parent 51ec675e00
commit 3d0b754332
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
2 changed files with 9 additions and 3 deletions

View file

@ -226,7 +226,10 @@ const currentClip = inject<Ref<Misskey.entities.Clip> | null>('currentClip', nul
let note = $ref(deepClone(props.note));
function noteclick(id: string) {
router.push(`/notes/${id}`);
const selection = document.getSelection();
if (selection?.toString().length === 0) {
router.push(`/notes/${id}`);
}
}
// plugin