fix note move to different parent in note cache

This commit is contained in:
azivner
2018-08-31 19:55:56 +02:00
parent fdc3a7a7f2
commit c55bc471db
3 changed files with 17 additions and 9 deletions

View File

@@ -27,6 +27,13 @@ class Branch extends Entity {
// notePosition is not part of hash because it would produce a lot of updates in case of reordering
static get hashedProperties() { return ["branchId", "noteId", "parentNoteId", "isDeleted", "prefix"]; }
constructor(row = {}) {
super(row);
// used to detect move in note tree
this.origParentNoteId = this.parentNoteId;
}
async getNote() {
return await repository.getEntity("SELECT * FROM notes WHERE noteId = ?", [this.noteId]);
}