Fix item-not-loaded error resetting data in unloaded library
This commit is contained in:
parent
302efb0854
commit
d19732ba5f
|
@ -188,6 +188,11 @@ Zotero.Sync.Data.Local = {
|
||||||
|
|
||||||
// Reset library
|
// Reset library
|
||||||
if (index == 0) {
|
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);
|
yield this.resetUnsyncedLibraryData(libraryID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -201,6 +206,11 @@ Zotero.Sync.Data.Local = {
|
||||||
|
|
||||||
// Reset library files
|
// Reset library files
|
||||||
if (index == 0) {
|
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);
|
yield this.resetUnsyncedLibraryFiles(libraryID);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user