recent notes doesn't fail totally when we can't find title for some note

This commit is contained in:
azivner 2018-02-11 15:33:10 -05:00
parent 438f7c5b0b
commit f9f8ecb2b1
2 changed files with 12 additions and 2 deletions

View File

@ -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,

View File

@ -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;