|
|
|
@ -345,11 +345,19 @@ export class PublicationTree implements AsyncIterable<NDKEvent | null> { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.#cursor.target!.status === PublicationTreeNodeStatus.Error) { |
|
|
|
|
|
|
|
return { done: false, value: null }; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const event = await this.getEvent(this.#cursor.target!.address); |
|
|
|
const event = await this.getEvent(this.#cursor.target!.address); |
|
|
|
return { done: false, value: event }; |
|
|
|
return { done: false, value: event }; |
|
|
|
} |
|
|
|
} |
|
|
|
} while (this.#cursor.tryMoveToParent()); |
|
|
|
} while (this.#cursor.tryMoveToParent()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.#cursor.target!.status === PublicationTreeNodeStatus.Error) { |
|
|
|
|
|
|
|
return { done: false, value: null }; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// If we get to this point, we're at the root node (can't move up any more).
|
|
|
|
// If we get to this point, we're at the root node (can't move up any more).
|
|
|
|
return { done: true, value: null }; |
|
|
|
return { done: true, value: null }; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -370,11 +378,19 @@ export class PublicationTree implements AsyncIterable<NDKEvent | null> { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.#cursor.target!.status === PublicationTreeNodeStatus.Error) { |
|
|
|
|
|
|
|
return { done: false, value: null }; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const event = await this.getEvent(this.#cursor.target!.address); |
|
|
|
const event = await this.getEvent(this.#cursor.target!.address); |
|
|
|
return { done: false, value: event }; |
|
|
|
return { done: false, value: event }; |
|
|
|
} |
|
|
|
} |
|
|
|
} while (this.#cursor.tryMoveToParent()); |
|
|
|
} while (this.#cursor.tryMoveToParent()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.#cursor.target!.status === PublicationTreeNodeStatus.Error) { |
|
|
|
|
|
|
|
return { done: false, value: null }; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return { done: true, value: null }; |
|
|
|
return { done: true, value: null }; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|