mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-05-22 14:56:38 +00:00
Try another order
This commit is contained in:
parent
f81d72af2f
commit
f3b49b2a40
@ -30,7 +30,6 @@ class OrbitList extends List {
|
|||||||
}
|
}
|
||||||
|
|
||||||
join(other) {
|
join(other) {
|
||||||
super.join(other);
|
|
||||||
|
|
||||||
// WIP: fetch missing nodes
|
// WIP: fetch missing nodes
|
||||||
let depth = 0;
|
let depth = 0;
|
||||||
@ -46,13 +45,14 @@ class OrbitList extends List {
|
|||||||
const indices = item.heads.map((k) => _.findIndex(this._items, (b) => b.hash === k));
|
const indices = item.heads.map((k) => _.findIndex(this._items, (b) => b.hash === k));
|
||||||
const idx = indices.length > 0 ? Math.max(_.max(indices) + 1, 0) : 0;
|
const idx = indices.length > 0 ? Math.max(_.max(indices) + 1, 0) : 0;
|
||||||
this._items.splice(idx, 0, item)
|
this._items.splice(idx, 0, item)
|
||||||
// console.log("added", item.compactId, "at", idx, item.data, depth);
|
console.log("added", item.compactId, "at", idx, item.data, depth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
other.items.forEach((e) => e.heads.forEach(fetchRecursive));
|
other.items.forEach((e) => e.heads.forEach(fetchRecursive));
|
||||||
// console.log("--> Fetched", MaxHistory, "items from the history\n");
|
console.log("--> Fetched", MaxHistory, "items from the history\n");
|
||||||
|
super.join(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user