Skip invalid on-demand download attempt if not yet synced

This could happen if an account was set up for syncing but Zotero was
pointed at a new DB and then you double-clicked on a missing attachment.
This commit is contained in:
Dan Stillman 2019-10-18 18:06:46 -04:00
parent cfa77381a2
commit eef25677bf

View file

@ -32,6 +32,12 @@ Zotero.Sync.Storage.Local = {
},
getEnabledForLibrary: function (libraryID) {
// The user must have synced for the first time before we allow storage requests.
// This is relevant if an account is set up for syncing but the DB file is cleared and the
// user double-clicks on a missing file in download-as-needed mode.
if (!Zotero.Users.getCurrentUserID()) {
return false;
}
var libraryType = Zotero.Libraries.get(libraryID).libraryType;
switch (libraryType) {
case 'user':