caching initial noteset to improve search times

This commit is contained in:
zadam
2021-10-06 19:59:29 +02:00
parent 17fe9a6a1b
commit df8706026e
6 changed files with 40 additions and 12 deletions

View File

@@ -81,7 +81,7 @@ class Branch extends AbstractEntity {
get childNote() {
if (!(this.noteId in this.becca.notes)) {
// entities can come out of order in sync, create skeleton which will be filled later
this.becca.notes[this.noteId] = new Note({noteId: this.noteId});
this.becca.addNote(this.noteId, new Note({noteId: this.noteId}));
}
return this.becca.notes[this.noteId];
@@ -95,7 +95,7 @@ class Branch extends AbstractEntity {
get parentNote() {
if (!(this.parentNoteId in this.becca.notes)) {
// entities can come out of order in sync, create skeleton which will be filled later
this.becca.notes[this.parentNoteId] = new Note({noteId: this.parentNoteId});
this.becca.addNote(this.parentNoteId, new Note({noteId: this.parentNoteId}));
}
return this.becca.notes[this.parentNoteId];