summaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-06-25 15:56:30 -0700
committerAlex Yatskov <alex@foosoft.net>2017-06-25 15:56:30 -0700
commit1849f95b4ecf618a250d37268ad6d2a7f3ea8888 (patch)
treebf3bc0e034380286f9570fb53882dc2199d0ab95 /ext/bg/js
parent4cb7e8d2ac9bca9912dc728a0bd43f643bff6dda (diff)
simplify file loading
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/util.js9
1 files changed, 1 insertions, 8 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index ea307b6b..cdd5ec31 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -456,14 +456,7 @@ function jsonLoadInt(url) {
*/
function zipLoadDb(archive, indexLoaded, termsLoaded, kanjiLoaded) {
- return JSZip.loadAsync(archive).then(files => {
- const fileMap = {};
- files.forEach((path, file) => {
- fileMap[path] = file;
- });
-
- return fileMap;
- }).then(files => {
+ return JSZip.loadAsync(archive).then(files => files.files).then(files => {
const indexFile = files['index.json'];
if (!indexFile) {
return Promise.reject('no dictionary index found in archive');