diff --git a/package.json b/package.json index c717f4412..34c1319ae 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "commonmark": "0.30.0", "cookie-parser": "1.4.6", "csurf": "1.11.0", - "dayjs": "1.11.2", + "dayjs": "1.11.3", "ejs": "3.1.8", "electron-debug": "3.2.0", "electron-dl": "3.3.1", diff --git a/src/becca/entities/note.js b/src/becca/entities/note.js index 662a0ba78..4b43f07dc 100644 --- a/src/becca/entities/note.js +++ b/src/becca/entities/note.js @@ -1133,6 +1133,10 @@ class Note extends AbstractEntity { * @param {TaskContext} [taskContext] */ deleteNote(deleteId, taskContext) { + if (this.isDeleted) { + return; + } + if (!deleteId) { deleteId = utils.randomString(10); } diff --git a/src/public/stylesheets/style.css b/src/public/stylesheets/style.css index 892ff4c2c..ce13ddd6e 100644 --- a/src/public/stylesheets/style.css +++ b/src/public/stylesheets/style.css @@ -971,3 +971,8 @@ input { .note-split.full-content-width { max-width: 999999px; } + +button.close:hover { + text-shadow: none; + color: currentColor; +} diff --git a/src/public/stylesheets/tree.css b/src/public/stylesheets/tree.css index fd8d359b8..15999fdc7 100644 --- a/src/public/stylesheets/tree.css +++ b/src/public/stylesheets/tree.css @@ -170,7 +170,6 @@ span.fancytree-active .fancytree-title { } span.fancytree-selected { - color: var(--hover-item-text-color) !important; border-color: var(--main-border-color) !important; border-radius: 5px; } diff --git a/src/routes/api/search.js b/src/routes/api/search.js index 0c020e746..f164a290f 100644 --- a/src/routes/api/search.js +++ b/src/routes/api/search.js @@ -7,15 +7,16 @@ const scriptService = require('../../services/script'); const searchService = require('../../services/search/services/search'); const bulkActionService = require("../../services/bulk_actions"); const {formatAttrForSearch} = require("../../services/attribute_formatter"); +const utils = require("../../services/utils.js"); -async function searchFromNoteInt(note) { +function searchFromNoteInt(note) { let searchResultNoteIds; const searchScript = note.getRelationValue('searchScript'); const searchString = note.getLabelValue('searchString'); if (searchScript) { - searchResultNoteIds = await searchFromRelation(note, 'searchScript'); + searchResultNoteIds = searchFromRelation(note, 'searchScript'); } else { const searchContext = new SearchContext({ fastSearch: note.hasLabel('fastSearch'), @@ -57,7 +58,7 @@ async function searchFromNote(req) { return await searchFromNoteInt(note); } -async function searchAndExecute(req) { +function searchAndExecute(req) { const note = becca.getNote(req.params.noteId); if (!note) { @@ -73,7 +74,7 @@ async function searchAndExecute(req) { return [400, `Note ${req.params.noteId} is not a search note.`] } - const searchResultNoteIds = await searchFromNoteInt(note); + const searchResultNoteIds = searchFromNoteInt(note); bulkActionService.executeActions(note, searchResultNoteIds); } diff --git a/src/services/search/services/search.js b/src/services/search/services/search.js index c8729e365..b5389569e 100644 --- a/src/services/search/services/search.js +++ b/src/services/search/services/search.js @@ -78,6 +78,10 @@ function findResultsWithExpression(expression, searchContext) { const searchResults = noteSet.notes .map(note => { + if (note.isDeleted) { + return null; + } + const notePathArray = executionContext.noteIdToNotePath[note.noteId] || beccaService.getSomePath(note); if (!notePathArray) { @@ -85,7 +89,8 @@ function findResultsWithExpression(expression, searchContext) { } return new SearchResult(notePathArray); - }); + }) + .filter(note => !!note); for (const res of searchResults) { res.computeScore(searchContext.highlightedTokens); @@ -129,7 +134,7 @@ function parseQueryToExpression(query, searchContext) { structuredExpressionTokens, expression }; - + log.info("Search debug: " + JSON.stringify(searchContext.debugInfo, null, 4)); } diff --git a/src/services/sql.js b/src/services/sql.js index 1f60ef52e..06159abda 100644 --- a/src/services/sql.js +++ b/src/services/sql.js @@ -242,9 +242,9 @@ function transactional(func) { return ret; } catch (e) { - const entityChanges = cls.getAndClearEntityChangeIds(); + const entityChangeIds = cls.getAndClearEntityChangeIds(); - if (entityChanges.length > 0) { + if (entityChangeIds.length > 0) { log.info("Transaction rollback dirtied the becca, forcing reload."); require('../becca/becca_loader').load();