mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fix for cloned notes at root level + better logging
This commit is contained in:
parent
a0bbd8c853
commit
0c6521545a
@ -4,7 +4,7 @@ const messaging = (function() {
|
|||||||
let ws = null;
|
let ws = null;
|
||||||
|
|
||||||
function logError(message) {
|
function logError(message) {
|
||||||
console.error(message);
|
console.trace(message);
|
||||||
|
|
||||||
if (ws && ws.readyState === 1) {
|
if (ws && ws.readyState === 1) {
|
||||||
ws.send(JSON.stringify({
|
ws.send(JSON.stringify({
|
||||||
|
@ -278,7 +278,9 @@ const noteTree = (function() {
|
|||||||
const list = $("<ul/>");
|
const list = $("<ul/>");
|
||||||
|
|
||||||
for (const parentNoteId of parents) {
|
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);
|
const title = getNotePathTitle(notePath);
|
||||||
|
|
||||||
let item;
|
let item;
|
||||||
@ -302,12 +304,19 @@ const noteTree = (function() {
|
|||||||
|
|
||||||
let parentNoteId = 'root';
|
let parentNoteId = 'root';
|
||||||
|
|
||||||
|
console.log('notePath: ' + notePath);
|
||||||
|
console.log('notePath chunks: ', notePath.split('/'));
|
||||||
|
|
||||||
for (const noteId of notePath.split('/')) {
|
for (const noteId of notePath.split('/')) {
|
||||||
|
console.log('noteId: ' + noteId);
|
||||||
|
|
||||||
titlePath.push(getNoteTitle(noteId, parentNoteId));
|
titlePath.push(getNoteTitle(noteId, parentNoteId));
|
||||||
|
|
||||||
parentNoteId = noteId;
|
parentNoteId = noteId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("Title path:", titlePath.join(' / '));
|
||||||
|
|
||||||
return titlePath.join(' / ');
|
return titlePath.join(' / ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,9 @@ function showError(message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function throwError(message) {
|
function throwError(message) {
|
||||||
throw new Error(message + ':' + new Error().stack);
|
messaging.logError(message);
|
||||||
|
|
||||||
|
throw new Error(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDateFromTS(timestamp) {
|
function getDateFromTS(timestamp) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user