Skip to content

Commit

Permalink
FIX BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrián Nicolás committed Nov 19, 2020
1 parent 9681b58 commit 42a0e2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/download.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var zip = require('./zip');

module.exports = function(gj, options) {
var content = zip(gj, options);
location.href = 'data:application/zip;base64,' + content;
zip(gj, options).then(function(content) {
location.href = 'data:application/zip;base64,' + content;
});
};
6 changes: 3 additions & 3 deletions src/zip.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ module.exports = function(gj, options) {
}
});

var generateOptions = { compression:'STORE' };
var generateOptions = { compression:'STORE', type:'base64' };

if (!process.browser) {
generateOptions.type = 'nodebuffer';
}

return zip.generate(generateOptions);
return zip.generateAsync(generateOptions);
};

0 comments on commit 42a0e2f

Please sign in to comment.