www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit d19732ba5f0b8ba216656cff69f6a1ad16f01c61
parent 302efb08549c11c3e9b46c0b4095a7bd44f59441
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon,  5 Dec 2016 05:05:09 -0500

Fix item-not-loaded error resetting data in unloaded library

Diffstat:
Mchrome/content/zotero/xpcom/sync/syncLocal.js | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/sync/syncLocal.js b/chrome/content/zotero/xpcom/sync/syncLocal.js @@ -188,6 +188,11 @@ Zotero.Sync.Data.Local = { // Reset library if (index == 0) { + // This check happens before item data is loaded for syncing, so do it now, + // since the reset requires it + if (!library.getDataLoaded('item')) { + yield library.waitForDataLoad('item'); + } yield this.resetUnsyncedLibraryData(libraryID); return true; } @@ -201,6 +206,11 @@ Zotero.Sync.Data.Local = { // Reset library files if (index == 0) { + // This check happens before item data is loaded for syncing, so do it now, + // since the reset requires it + if (!library.getDataLoaded('item')) { + yield library.waitForDataLoad('item'); + } yield this.resetUnsyncedLibraryFiles(libraryID); return true; }