mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 09:45:52 +01:00
note title widget and protected session entering fixes
This commit is contained in:
@@ -57,6 +57,10 @@ export default class NoteTitleWidget extends TabAwareWidget {
|
||||
|
||||
this.$noteTitle.prop("readonly", note.isProtected && !protectedSessionHolder.isProtectedSessionAvailable());
|
||||
|
||||
this.setProtectedStatus(note);
|
||||
}
|
||||
|
||||
setProtectedStatus(note) {
|
||||
this.$noteTitle.toggleClass("protected", !!note.isProtected);
|
||||
}
|
||||
|
||||
@@ -88,7 +92,8 @@ export default class NoteTitleWidget extends TabAwareWidget {
|
||||
|
||||
entitiesReloadedEvent({loadResults}) {
|
||||
if (loadResults.isNoteReloaded(this.noteId)) {
|
||||
this.refresh();
|
||||
// not updating the title specifically since the synced title might be older than what the user is currently typing
|
||||
this.setProtectedStatus(this.note);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user