Skip to content

Build your personal knowledge base with Trilium Notes

Merge branch 'master' into next61

zadamac56056f65de
diff --cc src/routes/api/recent_changes.js
index e8492de0ea,ca0a23c712..00b0df681e
--- a/src/routes/api/recent_changes.js
+++ b/src/routes/api/recent_changes.js
@@@ -17,18 -17,19 +17,19 @@@ function getRecentChanges(req)
notes.deleteId AS current_deleteId,
notes.title AS current_title,
notes.isProtected AS current_isProtected,
- note_revisions.title,
- note_revisions.utcDateCreated AS utcDate,
- note_revisions.dateCreated AS date
+ revisions.title,
+ revisions.utcDateCreated AS utcDate,
+ revisions.dateCreated AS date
FROM
- note_revisions
+ revisions
JOIN notes USING(noteId)`);
- for (const noteRevisionRow of noteRevisionRows) {
- const note = becca.getNote(noteRevisionRow.noteId);
+ for (const revisionRow of revisionRows) {
+ const note = becca.getNote(revisionRow.noteId);
- if (note?.hasAncestor(ancestorNoteId)) {
+ // for deleted notes, the becca note is null, and it's not possible to (easily) determine if it belongs to a subtree
+ if (ancestorNoteId === 'root' || note?.hasAncestor(ancestorNoteId)) {
- recentChanges.push(noteRevisionRow);
+ recentChanges.push(revisionRow);
}
}