note title widget and protected session entering fixes

This commit is contained in:
zadam
2020-05-03 22:49:20 +02:00
parent 647790885d
commit 8b5536ee3a
5 changed files with 30 additions and 25 deletions

View File

@@ -486,7 +486,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
return true;
}
else {
const childBranches = await this.getChildBranches(note);
const childBranches = this.getChildBranches(note);
return childBranches.length > 0;
}
@@ -497,7 +497,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
const noteList = [];
for (const branch of await this.getChildBranches(parentNote)) {
for (const branch of this.getChildBranches(parentNote)) {
const node = await this.prepareNode(branch);
noteList.push(node);
@@ -506,7 +506,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
return noteList;
}
async getChildBranches(parentNote) {
getChildBranches(parentNote) {
let childBranches = parentNote.getChildBranches();
if (!childBranches) {
@@ -521,20 +521,6 @@ export default class NoteTreeWidget extends TabAwareWidget {
childBranches = childBranches.filter(branch => !imageLinks.find(rel => rel.value === branch.noteId));
}
if (this.hideArchivedNotes) {
const filteredBranches = [];
for (const childBranch of childBranches) {
const childNote = await childBranch.getNote();
if (!childNote.hasLabel('archived')) {
filteredBranches.push(childBranch);
}
}
childBranches = filteredBranches;
}
return childBranches;
}