From 6dce13bc340713d3800e3af76d865fae7ed28bf6 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 3 Jan 2023 21:30:49 +0100 Subject: [PATCH] export root note fix, #2346 --- src/public/app/menus/tree_context_menu.js | 2 +- src/public/app/services/froca.js | 14 +++++++------- src/routes/api/export.js | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/public/app/menus/tree_context_menu.js b/src/public/app/menus/tree_context_menu.js index 98ebebadc..52300b962 100644 --- a/src/public/app/menus/tree_context_menu.js +++ b/src/public/app/menus/tree_context_menu.js @@ -32,7 +32,7 @@ export default class TreeContextMenu { const isHoisted = note.noteId === appContext.tabManager.getActiveContext().hoistedNoteId; const parentNote = isNotRoot ? await froca.getNote(branch.parentNoteId) : null; - // some actions don't support multi-note so they are disabled when notes are selected + // some actions don't support multi-note, so they are disabled when notes are selected // the only exception is when the only selected note is the one that was right-clicked, then // it's clear what the user meant to do. const selNodes = this.treeWidget.getSelectedNodes(); diff --git a/src/public/app/services/froca.js b/src/public/app/services/froca.js index 2526c648b..0019b0bd8 100644 --- a/src/public/app/services/froca.js +++ b/src/public/app/services/froca.js @@ -216,7 +216,7 @@ class Froca { getNotesFromCache(noteIds, silentNotFoundError = false) { return noteIds.map(noteId => { if (!this.notes[noteId] && !silentNotFoundError) { - console.trace(`Can't find note "${noteId}"`); + console.trace(`Can't find note '${noteId}'`); return null; } @@ -235,7 +235,7 @@ class Froca { return noteIds.map(noteId => { if (!this.notes[noteId] && !silentNotFoundError) { - console.trace(`Can't find note "${noteId}"`); + console.trace(`Can't find note '${noteId}'`); return null; } else { @@ -285,7 +285,7 @@ class Froca { getBranch(branchId, silentNotFoundError = false) { if (!(branchId in this.branches)) { if (!silentNotFoundError) { - logError(`Not existing branch ${branchId}`); + logError(`Not existing branch '${branchId}'`); } } else { @@ -295,13 +295,13 @@ class Froca { async getBranchId(parentNoteId, childNoteId) { if (childNoteId === 'root') { - return 'root'; + return 'none_root'; } const child = await this.getNote(childNoteId); if (!child) { - logError(`Could not find branchId for parent=${parentNoteId}, child=${childNoteId} since child does not exist`); + logError(`Could not find branchId for parent '${parentNoteId}', child '${childNoteId}' since child does not exist`); return null; } @@ -318,9 +318,9 @@ class Froca { .then(row => new NoteComplement(row)) .catch(e => console.error(`Cannot get note complement for note '${noteId}'`)); - // we don't want to keep large payloads forever in memory so we clean that up quite quickly + // we don't want to keep large payloads forever in memory, so we clean that up quite quickly // this cache is more meant to share the data between different components within one business transaction (e.g. loading of the note into the tab context and all the components) - // this is also a work around for missing invalidation after change + // this is also a workaround for missing invalidation after change this.noteComplementPromises[noteId].then( () => setTimeout(() => this.noteComplementPromises[noteId] = null, 1000) ); diff --git a/src/routes/api/export.js b/src/routes/api/export.js index 365c7e185..6294f2f25 100644 --- a/src/routes/api/export.js +++ b/src/routes/api/export.js @@ -13,7 +13,7 @@ function exportBranch(req, res) { const branch = becca.getBranch(branchId); if (!branch) { - const message = `Cannot export branch ${branchId} since it does not exist.`; + const message = `Cannot export branch '${branchId}' since it does not exist.`; log.error(message); res.setHeader("Content-Type", "text/plain")