Tell connector to reinit after moving data directory

This commit is contained in:
Dan Stillman 2016-11-13 04:50:00 -05:00
parent cfc7f36829
commit ce6a0ecb01
2 changed files with 9 additions and 0 deletions

View file

@ -93,6 +93,11 @@ Zotero.IPC = new function() {
// translators
Zotero.initComplete();
}
else if (msg == "reinit") {
if (Zotero.isConnector) {
reinit(false, true);
}
}
}
}

View file

@ -1495,6 +1495,10 @@ Components.utils.import("resource://gre/modules/osfile.jsm");
// Set data directory again
Zotero.debug("Using new data directory " + newDir);
this._cacheDataDirectory(newDir);
// Tell Zotero for Firefox in connector mode to reload and find the new data directory
if (this.isStandalone) {
Zotero.IPC.broadcast('reinit');
}
// At least the database was copied, but other things failed
if (errors.length) {