Commit a1799a76 authored by Boris Kocherov's avatar Boris Kocherov

ZipFileStorage: use .push() instead .then() thx @cedric.leninivin

parent 0c196e40
...@@ -63,28 +63,25 @@ ...@@ -63,28 +63,25 @@
* @constructor * @constructor
*/ */
function ZipFileStorage(spec) { function ZipFileStorage(spec) {
var storage = this,
zip = new JSZip();
if (spec.file) { if (spec.file) {
//if (spec.file instanceof Blob) {
// throw new TypeError("ZipFileStorage 'url' is not of type string");
//}
var storage = this;
this._unzip_queue = new RSVP.Queue() this._unzip_queue = new RSVP.Queue()
.push(function () { .push(function () {
var zip = new JSZip();
return zip.loadAsync(spec.file, { return zip.loadAsync(spec.file, {
createFolders: true, createFolders: true,
checkCRC32: true checkCRC32: true
}) });
.then(function () { })
storage._zip = zip; .push(function () {
return zip; storage._zip = zip;
}, function (error) { return zip;
storage._error = error; }, function (error) {
throw error; storage._error = error;
}); throw error;
}); });
} else { } else {
this._zip = new JSZip(); this._zip = zip;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment