From 2e794ee38ffda471980f361a57da6e517d16d382 Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 16 Apr 2023 09:26:52 +0200 Subject: [PATCH] fixes --- src/becca/entities/bnote.js | 3 +-- src/services/search/expressions/note_flat_text.js | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/becca/entities/bnote.js b/src/becca/entities/bnote.js index 0f1b3ea8b..b8e58c740 100644 --- a/src/becca/entities/bnote.js +++ b/src/becca/entities/bnote.js @@ -12,7 +12,6 @@ const TaskContext = require("../../services/task_context"); const dayjs = require("dayjs"); const utc = require('dayjs/plugin/utc'); const eventService = require("../../services/events"); -const froca = require("../../public/app/services/froca.js"); dayjs.extend(utc); const LABEL = 'label'; @@ -1201,7 +1200,7 @@ class BNote extends AbstractBeccaEntity { const notePaths = this.getAllNotePaths().map(path => ({ notePath: path, isInHoistedSubTree: isHoistedRoot || path.includes(hoistedNoteId), - isArchived: path.some(noteId => froca.notes[noteId].isArchived), + isArchived: path.some(noteId => this.becca.notes[noteId].isArchived), isHidden: path.includes('_hidden') })); diff --git a/src/services/search/expressions/note_flat_text.js b/src/services/search/expressions/note_flat_text.js index 024160985..9dbf8ba9c 100644 --- a/src/services/search/expressions/note_flat_text.js +++ b/src/services/search/expressions/note_flat_text.js @@ -22,10 +22,12 @@ class NoteFlatTextExp extends Expression { * @param {string[]} tokens * @param {string[]} path */ - function searchDownThePath(note, tokens, path) { + const searchDownThePath = (note, tokens, path) => { if (tokens.length === 0) { const retPath = this.getNotePath(note, path); + console.log(retPath); + if (retPath) { const noteId = retPath[retPath.length - 1]; @@ -136,7 +138,7 @@ class NoteFlatTextExp extends Expression { return note.getBestNotePath(); } else { const closestNoteId = path[0]; - const closestNoteBestNotePath = becca.getNote(closestNoteId).getBestNotePathString(); + const closestNoteBestNotePath = becca.getNote(closestNoteId).getBestNotePath(); return [...closestNoteBestNotePath, ...path.slice(1)]; }