Skip to content

Build your personal knowledge base with Trilium Notes

fixed switching between note clones

azivner550bb77ca9a2
diff --git a/public/javascripts/link.js b/public/javascripts/link.js
index a74ce9b702..29041a436a 100644
--- a/public/javascripts/link.js
+++ b/public/javascripts/link.js
@@ -42,19 +42,23 @@ const link = (function() {
e.preventDefault();
const linkEl = $(e.target);
- const address = linkEl.attr("note-path") ? linkEl.attr("note-path") : linkEl.attr('href');
+ let notePath = linkEl.attr("note-path");
- if (!address) {
- return;
- }
+ if (!notePath) {
+ const address = linkEl.attr("note-path") ? linkEl.attr("note-path") : linkEl.attr('href');
- if (address.startsWith('http')) {
- window.open(address, '_blank');
+ if (!address) {
+ return;
+ }
- return;
- }
+ if (address.startsWith('http')) {
+ window.open(address, '_blank');
- const notePath = getNotePathFromLink(address);
+ return;
+ }
+
+ notePath = getNotePathFromLink(address);
+ }
noteTree.activateNode(notePath);