Fixed tree reset after sync, optimized sync with IndexedDB

This commit is contained in:
Magnus Åhall 2026-05-03 19:45:39 +02:00
parent 454d065baa
commit 26ca510785
5 changed files with 72 additions and 52 deletions

View file

@ -54,7 +54,7 @@ export class Node {
if (a.data.Name > b.data.Name) return 0
return 0
}//}}}
static create(name, parentUUID) {
static create(name, parentUUID) {// {{{
return new Node({
UUID: uuidv7(),
Created: (new Date()).toISOString(),
@ -64,7 +64,7 @@ export class Node {
Markdown: false,
History: false,
})
}
}// }}}
constructor(nodeData, level) {//{{{
@ -123,9 +123,6 @@ export class Node {
return this._children_fetched
}//}}}
async fetchChildren() {//{{{
if (this._children_fetched)
return this.Children
this.Children = await nodeStore.getTreeNodes(this.UUID, this.Level + 1)
this._children_fetched = true