Fix set initial load

This commit is contained in:
hppeng 2022-06-26 05:18:23 -07:00
parent 89879e6a02
commit 72999c3014
4 changed files with 10 additions and 5 deletions

View file

@ -187,7 +187,6 @@ class Build{
}
statMap.set(id,(statMap.get(id) || 0)+value);
}
console.log(item_stats);
for (const staticID of staticIDs) {
if (item_stats.get(staticID)) {
statMap.set(staticID, statMap.get(staticID) + item_stats.get(staticID));

View file

@ -832,7 +832,6 @@ class AggregateStatsNode extends ComputeNode {
}
}
}
console.log(output_stats);
return output_stats;
}
}

View file

@ -1,4 +1,5 @@
let atree_map;
let atree_head;
let atree_connectors_map;
let atree_active_connections = [];
function construct_AT(elem, tree) {
@ -26,6 +27,11 @@ function construct_AT(elem, tree) {
// create rows if not exist
let missing_rows = [node.display.row];
if (node.parents.length == 0) {
// Assuming there is only one head.
atree_head = node;
}
for (let parent of node.parents) {
missing_rows.push(tree.find(object => {return object.display_name === parent;}).display.row);
}

View file

@ -103,7 +103,7 @@ async function load() {
let url = baseUrl + "/compress.json?"+new Date();
let result = await (await fetch(url)).json();
items = result.items;
sets = result.sets;
let sets_ = result.sets;
let add_tx = db.transaction(['item_db', 'set_db'], 'readwrite');
add_tx.onabort = function(e) {
@ -121,8 +121,9 @@ async function load() {
add_promises.push(req);
}
let sets_store = add_tx.objectStore('set_db');
for (const set in sets) {
add_promises.push(sets_store.add(sets[set], set));
for (const set in sets_) {
add_promises.push(sets_store.add(sets_[set], set));
sets.set(set, sets_[set]);
}
add_promises.push(add_tx.complete);