more debugging info for problems after sync

This commit is contained in:
zadam 2019-12-10 21:31:24 +01:00
parent 6f32d6fabe
commit c48dbb0913
3 changed files with 11 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class Branch {
/** @returns {NoteShort} */ /** @returns {NoteShort} */
async getNote() { async getNote() {
return await this.treeCache.getNote(this.noteId); return this.treeCache.getNote(this.noteId);
} }
/** @returns {boolean} true if it's top level, meaning its parent is root note */ /** @returns {boolean} true if it's top level, meaning its parent is root note */

View File

@ -65,6 +65,11 @@ async function getIcon(note) {
async function prepareNode(branch) { async function prepareNode(branch) {
const note = await branch.getNote(); const note = await branch.getNote();
if (!note) {
console.log(`Branch has no note: ${branch}`);
}
const title = (branch.prefix ? (branch.prefix + " - ") : "") + note.title; const title = (branch.prefix ? (branch.prefix + " - ") : "") + note.title;
const hoistedNoteId = await hoistedNoteService.getHoistedNoteId(); const hoistedNoteId = await hoistedNoteService.getHoistedNoteId();

View File

@ -161,6 +161,11 @@ class TreeCache {
/** @return {Promise<NoteShort>} */ /** @return {Promise<NoteShort>} */
async getNote(noteId, silentNotFoundError = false) { async getNote(noteId, silentNotFoundError = false) {
if (noteId === 'none') { if (noteId === 'none') {
console.log(`No 'none' note.`);
return null;
}
else if (!noteId) {
console.log(`Falsy noteId ${noteId}, returning null.`);
return null; return null;
} }