diff --git a/src/public/javascripts/dialogs/recent_notes.js b/src/public/javascripts/dialogs/recent_notes.js index ae63b21e4..ae660b1f4 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 17ea9eb0d..dedca8752 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