summaryrefslogtreecommitdiff
path: root/ext/bg/js/util.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-11-05 17:30:00 -0700
committerAlex Yatskov <alex@foosoft.net>2016-11-05 17:30:00 -0700
commite2f1560afa25274d3b0efd3ce8fc8a17740ab7cc (patch)
tree711a2817fc1b2e08e25560164aa151c0e47f4351 /ext/bg/js/util.js
parente4fa25894f7827c3461d2a7adc249a6f1aebc48b (diff)
WIP
Diffstat (limited to 'ext/bg/js/util.js')
-rw-r--r--ext/bg/js/util.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index 888bcb33..9b17f43c 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -117,11 +117,11 @@ function splitField(field) {
return field.length === 0 ? [] : field.split(' ');
}
-function importJsonDb(indexUrl, entitiesLoaded, entriesLoaded) {
+function importJsonDb(indexUrl, indexLoaded, entriesLoaded) {
const indexDir = indexUrl.slice(0, indexUrl.lastIndexOf('/'));
return loadJson(indexUrl).then(index => {
- if (entitiesLoaded !== null) {
- return entitiesLoaded(index.entities, index.banks).then(() => index);
+ if (indexLoaded !== null) {
+ return indexLoaded(index.title, index.entities, index.banks).then(() => index);
}
return index;
@@ -129,7 +129,7 @@ function importJsonDb(indexUrl, entitiesLoaded, entriesLoaded) {
const loaders = [];
for (let i = 1; i <= index.banks; ++i) {
const bankUrl = `${indexDir}/bank_${i}.json`;
- loaders.push(() => loadJson(bankUrl).then(entries => entriesLoaded(entries, index.banks, i)));
+ loaders.push(() => loadJson(bankUrl).then(entries => entriesLoaded(index.title, entries, index.banks, i)));
}
let chain = Promise.resolve();