1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

All: Reset time fields when duplicating a note (#2428)

This commit is contained in:
Andrey Dolgov
2020-02-05 06:18:14 -05:00
committed by GitHub
parent 69e70d88f4
commit aef4a88d7f
2 changed files with 18 additions and 1 deletions

View File

@ -511,7 +511,11 @@ class Note extends BaseItem {
if (!originalNote) throw new Error(`Unknown note: ${noteId}`);
let newNote = Object.assign({}, originalNote);
delete newNote.id;
const fieldsToReset = ['id', 'created_time', 'updated_time', 'user_created_time', 'user_updated_time'];
for (let field of fieldsToReset) {
delete newNote[field];
}
for (let n in changes) {
if (!changes.hasOwnProperty(n)) continue;