mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 21:36:05 +01:00
initializing note tree synchronously
This commit is contained in:
@@ -20,8 +20,6 @@ class TreeCache {
|
||||
async loadInitialTree() {
|
||||
const resp = await server.get('tree');
|
||||
|
||||
await this.loadParents(resp, false);
|
||||
|
||||
// clear the cache only directly before adding new content which is important for e.g. switching to protected session
|
||||
|
||||
/** @type {Object.<string, NoteShort>} */
|
||||
@@ -39,6 +37,14 @@ class TreeCache {
|
||||
this.addResp(resp);
|
||||
}
|
||||
|
||||
async loadSubTree(subTreeNoteId) {
|
||||
const resp = await server.get('tree?subTreeNoteId=' + subTreeNoteId);
|
||||
|
||||
this.addResp(resp);
|
||||
|
||||
return this.notes[subTreeNoteId];
|
||||
}
|
||||
|
||||
async loadParents(resp, additiveLoad) {
|
||||
const noteIds = new Set(resp.notes.map(note => note.noteId));
|
||||
const missingNoteIds = [];
|
||||
|
||||
Reference in New Issue
Block a user