mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 11:10:41 +01:00
fix(add_link): inserting link to selection not working properly (closes #6776)
This commit is contained in:
@@ -30,6 +30,14 @@ function AddLinkDialogComponent() {
|
|||||||
setShown(true);
|
setShown(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (hasSelection) {
|
||||||
|
setLinkType("hyper-link");
|
||||||
|
} else {
|
||||||
|
setLinkType("reference-link");
|
||||||
|
}
|
||||||
|
}, [ hasSelection ])
|
||||||
|
|
||||||
async function setDefaultLinkTitle(noteId: string) {
|
async function setDefaultLinkTitle(noteId: string) {
|
||||||
const noteTitle = await tree.getNoteTitle(noteId);
|
const noteTitle = await tree.getNoteTitle(noteId);
|
||||||
setLinkTitle(noteTitle);
|
setLinkTitle(noteTitle);
|
||||||
@@ -90,6 +98,7 @@ function AddLinkDialogComponent() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const autocompleteRef = useRef<HTMLInputElement>(null);
|
const autocompleteRef = useRef<HTMLInputElement>(null);
|
||||||
|
console.log("Add link ", linkType, hasSelection);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
|
|||||||
Reference in New Issue
Block a user