use owned attributes where it's a better fit

This commit is contained in:
zadam
2019-12-01 10:28:05 +01:00
parent 29c5e394ab
commit 5de92171a7
2 changed files with 3 additions and 3 deletions

View File

@@ -514,7 +514,7 @@ async function duplicateNote(noteId, parentNoteId) {
notePosition: origBranch ? origBranch.notePosition + 1 : null
}).save();
for (const attribute of await origNote.getAttributes()) {
for (const attribute of await origNote.getOwnedAttributes()) {
const attr = new Attribute(attribute);
attr.attributeId = undefined; // force creation of new attribute
attr.noteId = newNote.noteId;
@@ -530,7 +530,7 @@ async function duplicateNote(noteId, parentNoteId) {
sqlInit.dbReady.then(() => {
// first cleanup kickoff 5 minutes after startup
setTimeout(cls.wrap(eraseDeletedNotes), 0 * 60 * 1000);
setTimeout(cls.wrap(eraseDeletedNotes), 5 * 60 * 1000);
setInterval(cls.wrap(eraseDeletedNotes), 4 * 3600 * 1000);
});