diff --git a/src/lib/components/publications/TableOfContents.svelte b/src/lib/components/publications/TableOfContents.svelte index 9813d57..50296d2 100644 --- a/src/lib/components/publications/TableOfContents.svelte +++ b/src/lib/components/publications/TableOfContents.svelte @@ -40,13 +40,7 @@ } entry.expanded = expanded; - if (entry.childrenResolved) { - return; - } - - if (expanded) { - entry.resolveChildren(); - } + entry.resolveChildren(); } function handleEntryClick(address: string, expanded: boolean = false) { diff --git a/src/lib/components/publications/table_of_contents.svelte.ts b/src/lib/components/publications/table_of_contents.svelte.ts index 8665697..63d3b9c 100644 --- a/src/lib/components/publications/table_of_contents.svelte.ts +++ b/src/lib/components/publications/table_of_contents.svelte.ts @@ -148,8 +148,8 @@ export class TableOfContents { }); // Set up an observer to handle progressive resolution of the publication tree. - this.#publicationTree.onNodeResolved(async (address: string) => { - await this.#buildTocEntryFromResolvedNode(address); + this.#publicationTree.onNodeResolved((address: string) => { + this.#buildTocEntryFromResolvedNode(address); }); } diff --git a/src/lib/data_structures/publication_tree.ts b/src/lib/data_structures/publication_tree.ts index 515b866..a7aece6 100644 --- a/src/lib/data_structures/publication_tree.ts +++ b/src/lib/data_structures/publication_tree.ts @@ -623,7 +623,6 @@ export class PublicationTree implements AsyncIterable { this.addEventByAddress(address, event); } - // TODO: We may need to move this to `#addNode`, so the observer is notified more eagerly. this.#nodeResolvedObservers.forEach(observer => observer(address)); return node;