Skip to content

Build your personal knowledge base with Trilium Notes

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.js
index 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.js
index 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 = 0
AND note_tree.isDeleted = 0
ORDER BY
- dateAccessed DESC`);
+ dateAccessed DESC
+ LIMIT 200`);
}
module.exports = router;
\ No newline at end of file