Skip to content

Commit

Permalink
Don't keep checking for lost Z4Fx data directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed Aug 19, 2017
1 parent f45d561 commit 2919486
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions chrome/content/zotero/xpcom/dataDirectory.js
Expand Up @@ -550,7 +550,7 @@ Zotero.DataDirectory = {
checkForLostLegacy: async function () {
var currentDir = this.dir;
if (currentDir != this.defaultDir) return;
if (Zotero.Prefs.get('ignoreLegacyDataDir')) return;
if (Zotero.Prefs.get('ignoreLegacyDataDir.auto') || Zotero.Prefs.get('ignoreLegacyDataDir.explicit')) return;
try {
let profilesParent = OS.Path.dirname(Zotero.Profile.getOtherAppProfilesDir());
Zotero.debug("Looking for Firefox profile in " + profilesParent);
Expand Down Expand Up @@ -578,16 +578,19 @@ Zotero.DataDirectory = {
let info = await OS.File.stat(dbFile);
if (info.size < 1200000) {
Zotero.debug(`Legacy database is ${info.size} bytes -- ignoring`);
Zotero.Prefs.set('ignoreLegacyDataDir.auto', true);
return;
}
mtime = info.lastModificationDate;
if (mtime < new Date(2017, 6, 1)) {
Zotero.debug(`Legacy database was last modified on ${mtime.toString()} -- ignoring`);
Zotero.Prefs.set('ignoreLegacyDataDir.auto', true);
return;
}
Zotero.debug(`Legacy database found at ${dbFile}, last modified ${mtime}`);
}
catch (e) {
Zotero.Prefs.set('ignoreLegacyDataDir.auto', true);
if (e.becauseNoSuchFile) {
return;
}
Expand Down Expand Up @@ -620,7 +623,7 @@ Zotero.DataDirectory = {
return;
}
if (dontAskAgain.value) {
Zotero.Prefs.set('ignoreLegacyDataDir', true);
Zotero.Prefs.set('ignoreLegacyDataDir.explicit', true);
}
if (index == 0) {
return;
Expand Down

0 comments on commit 2919486

Please sign in to comment.