1
0
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:
Laurent Cozic 2023-06-08 15:09:10 +01:00
parent fb27ae991c
commit 0c6f779aab
2 changed files with 10 additions and 2 deletions

View File

@ -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];

View File

@ -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 };