diff --git a/public/javascripts/messaging.js b/public/javascripts/messaging.js
index af3888e16..1a1b272be 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.js
index 5f21c7cdb..68c020a49 100644
--- a/public/javascripts/note_tree.js
+++ b/public/javascripts/note_tree.js
@@ -278,7 +278,9 @@ const noteTree = (function() {
const list = $("
");
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.js
index 97d5f9843..ab03172be 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) {