fix undelete

This commit is contained in:
zadam
2021-05-09 11:12:53 +02:00
parent 9afea492db
commit ef0941479c
8 changed files with 44 additions and 27 deletions

View File

@@ -79,7 +79,7 @@ class Note extends AbstractEntity {
// ------ Derived attributes ------
/** @param {boolean} */
this.isDecrypted = !row.isProtected || !!row.isContentAvailable;
this.isDecrypted = !row.isProtected || row.isContentAvailable;
this.decrypt();
@@ -87,6 +87,12 @@ class Note extends AbstractEntity {
this.flatTextCache = null;
}
get isContentAvailable() {
return !this.noteId // new note which was not encrypted yet
|| !this.isProtected
|| protectedSessionService.isProtectedSessionAvailable()
}
getParentBranches() {
return this.parentBranches;
}
@@ -852,6 +858,7 @@ class Note extends AbstractEntity {
isProtected: this.isProtected,
type: this.type,
mime: this.mime,
isDeleted: false,
dateCreated: this.dateCreated,
dateModified: this.dateModified,
utcDateCreated: this.utcDateCreated,