Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
recent notes doesn't fail totally when we can't find title for some note
azivnerf9f8ecb2b18e
diff --git a/src/public/javascripts/dialogs/recent_notes.js b/src/public/javascripts/dialogs/recent_notes.jsindex ae63b21e4d..ae660b1f44 100644--- a/src/public/javascripts/dialogs/recent_notes.js+++ b/src/public/javascripts/dialogs/recent_notes.js@@ -40,7 +40,16 @@ const recentNotes = (function() {$searchInput.autocomplete({source: recNotes.map(notePath => {- const noteTitle = noteTree.getNotePathTitle(notePath);+ let noteTitle;++ try {+ noteTitle = noteTree.getNotePathTitle(notePath);+ }+ catch (e) {+ noteTitle = "[error - can't find note title]";++ messaging.logError("Could not find title for notePath=" + notePath + ", stack=" + e.stack);+ }return {label: noteTitle,diff --git a/src/routes/api/recent_notes.js b/src/routes/api/recent_notes.jsindex 17ea9eb0dd..dedca87527 100644--- a/src/routes/api/recent_notes.js+++ b/src/routes/api/recent_notes.js@@ -45,7 +45,8 @@ async function getRecentNotes() {recent_notes.isDeleted = 0AND note_tree.isDeleted = 0ORDER BY- dateAccessed DESC`);+ dateAccessed DESC+ LIMIT 200`);}module.exports = router;\ No newline at end of file