diff --git a/chrome/content/zotero/xpcom/storage/queue.js b/chrome/content/zotero/xpcom/storage/queue.js index 941e79e50..5b4962026 100644 --- a/chrome/content/zotero/xpcom/storage/queue.js +++ b/chrome/content/zotero/xpcom/storage/queue.js @@ -230,7 +230,12 @@ Zotero.Sync.Storage.Queue.prototype.start = function () { // The queue manager needs to know what queues were running in the // current session Zotero.Sync.Storage.QueueManager.addCurrentQueue(this); - this.advance(); + + var self = this; + setTimeout(function () { + self.advance(); + }, 0); + return this._deferred.promise; } diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js index a762079bd..108a4eccc 100644 --- a/chrome/content/zotero/xpcom/storage/webdav.js +++ b/chrome/content/zotero/xpcom/storage/webdav.js @@ -957,7 +957,7 @@ Zotero.Sync.Storage.WebDAV = (function () { obj._uploadFile = function (request) { var deferred = Q.defer(); - Zotero.Sync.Storage.createUploadFile( + var created = Zotero.Sync.Storage.createUploadFile( request, function (data) { deferred.resolve( @@ -967,6 +967,9 @@ Zotero.Sync.Storage.WebDAV = (function () { ); } ); + if (!created) { + return Q(false); + } return deferred.promise; };