Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix for cloned notes at root level + better logging
azivner0c6521545aed
diff --git a/public/javascripts/messaging.js b/public/javascripts/messaging.jsindex af3888e162..1a1b272be2 100644--- a/public/javascripts/messaging.js+++ b/public/javascripts/messaging.js@@ -4,7 +4,7 @@ const messaging = (function() {let ws = null;function logError(message) {- console.error(message);+ console.trace(message);if (ws && ws.readyState === 1) {ws.send(JSON.stringify({diff --git a/public/javascripts/note_tree.js b/public/javascripts/note_tree.jsindex 5f21c7cdb0..68c020a495 100644--- a/public/javascripts/note_tree.js+++ b/public/javascripts/note_tree.js@@ -278,7 +278,9 @@ const noteTree = (function() {const list = $("<ul/>");for (const parentNoteId of parents) {- const notePath = getSomeNotePath(parentNoteId) + '/' + noteId;+ const parentNotePath = getSomeNotePath(parentNoteId);+ // this is to avoid having root notes leading '/'+ const notePath = parentNotePath ? (parentNotePath + '/' + noteId) : noteId;const title = getNotePathTitle(notePath);let item;@@ -302,12 +304,19 @@ const noteTree = (function() {let parentNoteId = 'root';+ console.log('notePath: ' + notePath);+ console.log('notePath chunks: ', notePath.split('/'));+for (const noteId of notePath.split('/')) {+ console.log('noteId: ' + noteId);+titlePath.push(getNoteTitle(noteId, parentNoteId));parentNoteId = noteId;}+ console.log("Title path:", titlePath.join(' / '));+return titlePath.join(' / ');}diff --git a/public/javascripts/utils.js b/public/javascripts/utils.jsindex 97d5f9843c..ab03172be0 100644--- a/public/javascripts/utils.js+++ b/public/javascripts/utils.js@@ -31,7 +31,9 @@ function showError(message) {}function throwError(message) {- throw new Error(message + ':' + new Error().stack);+ messaging.logError(message);++ throw new Error(message);}function getDateFromTS(timestamp) {