From 1849f95b4ecf618a250d37268ad6d2a7f3ea8888 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 25 Jun 2017 15:56:30 -0700 Subject: [PATCH] simplify file loading --- ext/bg/js/util.js | 9 +-------- 1 file changed, 1 insertion(+), 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');