Skip to content

Build your personal knowledge base with Trilium Notes

isErased fixes

zadam6c15d299e003
diff --git a/src/public/app/services/link.js b/src/public/app/services/link.js
index 9d1d3bbf90..cd9cc493cb 100644
--- a/src/public/app/services/link.js
+++ b/src/public/app/services/link.js
@@ -144,11 +144,8 @@ async function loadReferenceLinkTitle(noteId, $el) {
if (!note) {
title = '[missing]';
}
- else if (!note.isDeleted) {
- title = note.title;
- }
else {
- title = note.isErased ? '[erased]' : `${note.title} (deleted)`;
+ title = note.isDeleted ? `${note.title} (deleted)` : note.title;
}
$el.text(title);
diff --git a/src/public/app/widgets/attribute_widgets/attribute_editor.js b/src/public/app/widgets/attribute_widgets/attribute_editor.js
index b34600d898..94f36d0ab1 100644
--- a/src/public/app/widgets/attribute_widgets/attribute_editor.js
+++ b/src/public/app/widgets/attribute_widgets/attribute_editor.js
@@ -446,11 +446,8 @@ export default class AttributeEditorWidget extends TabAwareWidget {
if (!note) {
title = '[missing]';
}
- else if (!note.isDeleted) {
- title = note.title;
- }
else {
- title = note.isErased ? '[erased]' : `${note.title} (deleted)`;
+ title = note.isDeleted ? `${note.title} (deleted)` : note.title;
}
$el.text(title);
diff --git a/src/services/notes.js b/src/services/notes.js
index c1034726fb..8df6ddd0cb 100644
--- a/src/services/notes.js
+++ b/src/services/notes.js
@@ -466,7 +466,7 @@ function saveNoteRevision(note) {
const revisionCutoff = dateUtils.utcDateStr(new Date(now.getTime() - noteRevisionSnapshotTimeInterval * 1000));
const existingNoteRevisionId = sql.getValue(
- "SELECT noteRevisionId FROM note_revisions WHERE noteId = ? AND isErased = 0 AND utcDateCreated >= ?", [note.noteId, revisionCutoff]);
+ "SELECT noteRevisionId FROM note_revisions WHERE noteId = ? AND utcDateCreated >= ?", [note.noteId, revisionCutoff]);
const msSinceDateCreated = now.getTime() - dateUtils.parseDateTime(note.utcDateCreated).getTime();
@@ -759,6 +759,8 @@ function duplicateSubtree(origNoteId, newParentNoteId) {
throw new Error('Duplicating root is not possible');
}
+ log.info(`Duplicating ${origNote} subtree into ${newParentNoteId}`);
+
const origNote = repository.getNote(origNoteId);
// might be null if orig note is not in the target newParentNoteId
const origBranch = origNote.getBranches().find(branch => branch.parentNoteId === newParentNoteId);