mirror of
https://github.com/zadam/trilium.git
synced 2025-02-24 23:13:43 +08:00
fix case where parents of templates are not loaded
(cherry picked from commit a3f4fc7762
)
This commit is contained in:
parent
0afd3c65aa
commit
93d0324177
1 changed files with 5 additions and 0 deletions
|
@ -20,6 +20,9 @@ class TreeCache {
|
||||||
async loadInitialTree() {
|
async loadInitialTree() {
|
||||||
const resp = await server.get('tree');
|
const resp = await server.get('tree');
|
||||||
|
|
||||||
|
// FIXME: we need to do this to cover for ascendants of template notes which are not loaded
|
||||||
|
await this.loadParents(resp, false);
|
||||||
|
|
||||||
// clear the cache only directly before adding new content which is important for e.g. switching to protected session
|
// clear the cache only directly before adding new content which is important for e.g. switching to protected session
|
||||||
|
|
||||||
/** @type {Object.<string, NoteShort>} */
|
/** @type {Object.<string, NoteShort>} */
|
||||||
|
@ -40,6 +43,8 @@ class TreeCache {
|
||||||
async loadSubTree(subTreeNoteId) {
|
async loadSubTree(subTreeNoteId) {
|
||||||
const resp = await server.get('tree?subTreeNoteId=' + subTreeNoteId);
|
const resp = await server.get('tree?subTreeNoteId=' + subTreeNoteId);
|
||||||
|
|
||||||
|
await this.loadParents(resp, true);
|
||||||
|
|
||||||
this.addResp(resp);
|
this.addResp(resp);
|
||||||
|
|
||||||
return this.notes[subTreeNoteId];
|
return this.notes[subTreeNoteId];
|
||||||
|
|
Loading…
Reference in a new issue