mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
recent notes doesn't fail totally when we can't find title for some note
This commit is contained in:
parent
438f7c5b0b
commit
f9f8ecb2b1
@ -40,7 +40,16 @@ const recentNotes = (function() {
|
|||||||
|
|
||||||
$searchInput.autocomplete({
|
$searchInput.autocomplete({
|
||||||
source: recNotes.map(notePath => {
|
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 {
|
return {
|
||||||
label: noteTitle,
|
label: noteTitle,
|
||||||
|
@ -45,7 +45,8 @@ async function getRecentNotes() {
|
|||||||
recent_notes.isDeleted = 0
|
recent_notes.isDeleted = 0
|
||||||
AND note_tree.isDeleted = 0
|
AND note_tree.isDeleted = 0
|
||||||
ORDER BY
|
ORDER BY
|
||||||
dateAccessed DESC`);
|
dateAccessed DESC
|
||||||
|
LIMIT 200`);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
Loading…
x
Reference in New Issue
Block a user