diff --git a/chrome/content/zotero/xpcom/storage/storageEngine.js b/chrome/content/zotero/xpcom/storage/storageEngine.js index a90ad809eb..dd9be82b68 100644 --- a/chrome/content/zotero/xpcom/storage/storageEngine.js +++ b/chrome/content/zotero/xpcom/storage/storageEngine.js @@ -77,7 +77,7 @@ Zotero.Sync.Storage.Engine = function (options) { Zotero.Sync.Storage.Engine.prototype.start = Zotero.Promise.coroutine(function* () { var libraryID = this.libraryID; - if (!Zotero.Prefs.get("sync.storage.enabled")) { + if (!Zotero.Sync.Storage.Local.getEnabledForLibrary(libraryID)) { Zotero.debug("File sync is not enabled for " + this.library.name); return false; } diff --git a/chrome/content/zotero/xpcom/storage/storageLocal.js b/chrome/content/zotero/xpcom/storage/storageLocal.js index a78b347654..ba9cc01dad 100644 --- a/chrome/content/zotero/xpcom/storage/storageLocal.js +++ b/chrome/content/zotero/xpcom/storage/storageLocal.js @@ -12,6 +12,24 @@ Zotero.Sync.Storage.Local = { lastFullFileCheck: {}, uploadCheckFiles: [], + getEnabledForLibrary: function (libraryID) { + var libraryType = Zotero.Libraries.get(libraryID).libraryType; + switch (libraryType) { + case 'user': + case 'publications': + return Zotero.Prefs.get("sync.storage.enabled"); + + case 'group': + return Zotero.Prefs.get("sync.storage.groups.enabled"); + + case 'feed': + return false; + + default: + throw new Error(`Unexpected library type '${libraryType}'`); + } + }, + getClassForLibrary: function (libraryID) { return Zotero.Sync.Storage.Utilities.getClassForMode(this.getModeForLibrary(libraryID)); }, diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 72cefda23b..af90c583ef 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -3936,7 +3936,8 @@ var ZoteroPane = new function() } else { if (!item.isImportedAttachment() - || !Zotero.Sync.Storage.Local.downloadAsNeeded(item.libraryID)) { + || (!Zotero.Sync.Storage.Local.getEnabledForLibrary(item.libraryID) + || !Zotero.Sync.Storage.Local.downloadAsNeeded(item.libraryID))) { this.showAttachmentNotFoundDialog(itemID, noLocateOnMissing); return; }