mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
defensive copies of owned attrs
This commit is contained in:
parent
bc8f531b33
commit
83049c95c3
@ -18,7 +18,7 @@ module.exports = () => {
|
|||||||
if (noteId.startsWith("_")) { // is "named" note
|
if (noteId.startsWith("_")) { // is "named" note
|
||||||
const note = becca.getNote(noteId);
|
const note = becca.getNote(noteId);
|
||||||
|
|
||||||
for (const attr of note.getOwnedAttributes()) {
|
for (const attr of note.getOwnedAttributes().slice()) {
|
||||||
attr.markAsDeleted("0212__delete_all_attributes_of_named_notes");
|
attr.markAsDeleted("0212__delete_all_attributes_of_named_notes");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -274,8 +274,6 @@ class AbstractBeccaEntity {
|
|||||||
[this.dateModified, entityId]);
|
[this.dateModified, entityId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.trace("DELETE");
|
|
||||||
|
|
||||||
log.info(`Marking ${entityName} ${entityId} as deleted`);
|
log.info(`Marking ${entityName} ${entityId} as deleted`);
|
||||||
|
|
||||||
this.addEntityChange(true);
|
this.addEntityChange(true);
|
||||||
@ -293,8 +291,6 @@ class AbstractBeccaEntity {
|
|||||||
WHERE ${this.constructor.primaryKeyName} = ?`,
|
WHERE ${this.constructor.primaryKeyName} = ?`,
|
||||||
[this.utcDateModified, entityId]);
|
[this.utcDateModified, entityId]);
|
||||||
|
|
||||||
console.trace("DELETE");
|
|
||||||
|
|
||||||
log.info(`Marking ${entityName} ${entityId} as deleted`);
|
log.info(`Marking ${entityName} ${entityId} as deleted`);
|
||||||
|
|
||||||
this.addEntityChange(true);
|
this.addEntityChange(true);
|
||||||
|
@ -191,7 +191,7 @@ class BBranch extends AbstractBeccaEntity {
|
|||||||
|
|
||||||
this.becca.notes[note.noteId].isBeingDeleted = true;
|
this.becca.notes[note.noteId].isBeingDeleted = true;
|
||||||
|
|
||||||
for (const attribute of note.getOwnedAttributes()) {
|
for (const attribute of note.getOwnedAttributes().slice()) {
|
||||||
attribute.markAsDeleted(deleteId);
|
attribute.markAsDeleted(deleteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user