unified/simplified protecting notes & subtree

This commit is contained in:
zadam
2020-02-26 16:37:17 +01:00
parent 3752cf8cba
commit 7bcae9981b
13 changed files with 84 additions and 90 deletions

View File

@@ -151,16 +151,14 @@ export default class NoteDetailWidget extends TabAwareWidget {
}
async getWidgetType() {
const note = this.note;
if (!note) {
if (!this.note) {
return "empty";
}
let type = note.type;
let type = this.note.type;
if (type === 'text' && !this.tabContext.autoBookDisabled
&& note.hasChildren()
&& this.note.hasChildren()
&& utils.isDesktop()) {
const noteComplement = await this.tabContext.getNoteComplement();
@@ -170,7 +168,7 @@ export default class NoteDetailWidget extends TabAwareWidget {
}
}
if (note.isProtected && !protectedSessionHolder.isProtectedSessionAvailable()) {
if (this.note.isProtected && !protectedSessionHolder.isProtectedSessionAvailable()) {
type = 'protected-session';
}