simplify file loading

This commit is contained in:
Alex Yatskov 2017-06-25 15:56:30 -07:00
parent 4cb7e8d2ac
commit 1849f95b4e

View File

@ -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');