mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-23 18:53:36 +02:00
Desktop: Fixes #8287: Duplicated published notes retain the published note's label's color
This commit is contained in:
parent
fb27ae991c
commit
0c6f779aab
@ -622,7 +622,14 @@ export default class Note extends BaseItem {
|
||||
if (!originalNote) throw new Error(`Unknown note: ${noteId}`);
|
||||
|
||||
const newNote = { ...originalNote };
|
||||
const fieldsToReset = ['id', 'created_time', 'updated_time', 'user_created_time', 'user_updated_time'];
|
||||
const fieldsToReset = [
|
||||
'id',
|
||||
'created_time',
|
||||
'updated_time',
|
||||
'user_created_time',
|
||||
'user_updated_time',
|
||||
'is_shared',
|
||||
];
|
||||
|
||||
for (const field of fieldsToReset) {
|
||||
delete (newNote as any)[field];
|
||||
|
@ -380,8 +380,9 @@ export default class Resource extends BaseItem {
|
||||
const resource = await Resource.load(resourceId);
|
||||
const localState = await Resource.localState(resource);
|
||||
|
||||
let newResource = { ...resource };
|
||||
let newResource: ResourceEntity = { ...resource };
|
||||
delete newResource.id;
|
||||
delete newResource.is_shared;
|
||||
newResource = await Resource.save(newResource);
|
||||
|
||||
const newLocalState = { ...localState };
|
||||
|
Loading…
x
Reference in New Issue
Block a user