From 2a53bb03ae0e0fde6c944d20c29b1211c659c742 Mon Sep 17 00:00:00 2001 From: azivner Date: Mon, 13 Aug 2018 21:01:14 +0200 Subject: [PATCH] fix autocomplete casing issue with first level notes --- src/services/note_cache.js | 6 +++--- src/services/repository.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/note_cache.js b/src/services/note_cache.js index 43d5bd147..0c69d9c65 100644 --- a/src/services/note_cache.js +++ b/src/services/note_cache.js @@ -109,7 +109,7 @@ function search(noteId, tokens, path, results) { } const parents = childToParent[noteId]; - if (!parents) { + if (!parents || noteId === 'root') { return; } @@ -119,11 +119,11 @@ function search(noteId, tokens, path, results) { } // archived must be inheritable - if (parentNoteId === 'root' || archived[parentNoteId] === 1) { + if (archived[parentNoteId] === 1) { continue; } - const title = getNoteTitle(noteId, parentNoteId); + const title = getNoteTitle(noteId, parentNoteId).toLowerCase(); const foundTokens = []; for (const token of tokens) { diff --git a/src/services/repository.js b/src/services/repository.js index cfcd25ae1..c77dce31f 100644 --- a/src/services/repository.js +++ b/src/services/repository.js @@ -65,6 +65,7 @@ async function updateEntity(entity) { delete clone.jsonContent; delete clone.isOwned; delete clone.isChanged; + delete clone.__attributeCache; for (const key in clone) { // !isBuffer is for images and attachments