From eef25677bfc3241c240cc00c9a78ed0522848183 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 18 Oct 2019 18:06:46 -0400 Subject: [PATCH] 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. --- chrome/content/zotero/xpcom/storage/storageLocal.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chrome/content/zotero/xpcom/storage/storageLocal.js b/chrome/content/zotero/xpcom/storage/storageLocal.js index bbf1f50bd3..5806b045fb 100644 --- a/chrome/content/zotero/xpcom/storage/storageLocal.js +++ b/chrome/content/zotero/xpcom/storage/storageLocal.js @@ -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':