Desktop: Fix: Notes would appear to be in the wrong notebook after having been shared

pull/5124/head
Laurent Cozic 2021-06-23 14:37:51 +01:00
parent b92ab2b8cc
commit 96931877cf
1 changed files with 2 additions and 1 deletions

View File

@ -329,7 +329,7 @@ export default class Folder extends BaseItem {
// Find all the notes where the share_id is not the same as the
// parent share_id because we only need to update those.
const rows = await this.db().selectAll(`
SELECT notes.id, folders.share_id
SELECT notes.id, folders.share_id, notes.parent_id
FROM notes
LEFT JOIN folders ON notes.parent_id = folders.id
WHERE notes.share_id != folders.share_id
@ -339,6 +339,7 @@ export default class Folder extends BaseItem {
await Note.save({
id: row.id,
share_id: row.share_id || '',
parent_id: row.parent_id,
updated_time: Date.now(),
}, { autoTimestamp: false });
}