From 4d4c0f9e73a69f79f7e42eaf0ac0417c1db0a148 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 9 May 2017 02:05:23 -0400 Subject: [PATCH] Don't display startup error when switching into connector mode And close DB on incompatible version error This should make things a bit smoother for people upgrading to 5.0 before Zotero for Firefox is updated to the connector. --- chrome/content/zotero/overlay.js | 7 +++++++ chrome/content/zotero/xpcom/zotero.js | 2 ++ 2 files changed, 9 insertions(+) diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index 43241c667..174e6ef80 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -103,6 +103,13 @@ var ZoteroOverlay = new function() if(newMode == "connector") { // save current state _stateBeforeReload = !zoteroPane.hidden && !zoteroPane.collapsed; + + // Don't display startup error when Standalone opens + if (Zotero.startupError) { + Zotero.debug(startupError, 1); + return; + } + // ensure pane is closed if(!zoteroPane.collapsed) ZoteroOverlay.toggleDisplay(false, true); } diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index ecc1fd6eb..b00e86559 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -611,6 +611,8 @@ Components.utils.import("resource://gre/modules/Services.jsm"); } catch (e) { if (e instanceof Zotero.DB.IncompatibleVersionException) { + Zotero.DB.closeDatabase(true).then(() => Zotero.debug("Database closed")); + let kbURL = "https://www.zotero.org/support/kb/newer_db_version"; let msg = (e.dbClientVersion ? Zotero.getString('startupError.incompatibleDBVersion',