diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index cbb7abf3b..b89c28cc7 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -1201,7 +1201,8 @@ Zotero.Sync.Storage = new function () { { onProgress: _updateProgress, onStop: _onUploadComplete, - item: item + item: item, + streams: [fis, bis] } ); channel.notificationCallbacks = listener; @@ -2019,9 +2020,10 @@ Zotero.Sync.Storage.ZipWriterObserver.prototype = { /** * Possible properties of data object: - * - onStart f(request) - * - onProgress f(name, progess, progressMax) - * - onStop f(request, status, response, data) + * - onStart: f(request) + * - onProgress: f(name, progess, progressMax) + * - onStop: f(request, status, response, data) + * - streams: array of streams to close on completion * - Other values to pass to onStop() */ Zotero.Sync.Storage.StreamListener = function (data) { @@ -2137,6 +2139,12 @@ Zotero.Sync.Storage.StreamListener.prototype = { request.QueryInterface(Components.interfaces.nsIRequest); } + if (this._data.streams) { + for each(var stream in this._data.streams) { + stream.close(); + } + } + if (this._data.onStop) { // Remove callbacks before passing along var passData = {};