mirror of https://codeberg.org/pzp/pzp-db.git
fix minor Tangle class issues
This commit is contained in:
parent
75b36e9730
commit
b87ca604eb
|
@ -224,8 +224,7 @@ class Tangle {
|
|||
|
||||
get root() {
|
||||
if (!this.#rootMsg) {
|
||||
console.trace('Tangle is missing root message')
|
||||
return null
|
||||
throw new Error(`Tangle "${this.#rootID}" is missing root message`)
|
||||
}
|
||||
return this.#rootMsg
|
||||
}
|
||||
|
@ -298,7 +297,8 @@ class Tangle {
|
|||
if (msgBID === this.#rootID) return false
|
||||
let toCheck = [msgBID]
|
||||
while (toCheck.length > 0) {
|
||||
const prev = this.#prev.get(/** @type {string} */ (toCheck.shift()))
|
||||
const checking = /** @type {string} */ (toCheck.shift())
|
||||
const prev = this.#prev.get(checking)
|
||||
if (!prev) continue
|
||||
if (prev.includes(msgAID)) return true
|
||||
toCheck.push(...prev)
|
||||
|
|
Loading…
Reference in New Issue