fixed saved search

This commit is contained in:
zadam
2019-02-15 21:21:26 +01:00
parent f140b77e7c
commit 96de2e7008
5 changed files with 95 additions and 75 deletions

View File

@@ -126,7 +126,9 @@ async function prepareRealBranch(parentNote) {
async function prepareSearchBranch(note) {
const fullNote = await noteDetailService.loadNote(note.noteId);
const results = (await server.get('search/' + encodeURIComponent(fullNote.jsonContent.searchString)))
const json = JSON.parse(fullNote.noteContent.content);
const results = (await server.get('search/' + encodeURIComponent(json.searchString)))
.filter(res => res.noteId !== note.noteId); // this is necessary because title of the search note is often the same as the search text which would match and create circle
// force to load all the notes at once instead of one by one