Block Mendeley import if ZotFile installed

This commit is contained in:
Tom Najdek 2022-11-09 14:19:52 +01:00
parent 4b523555d6
commit 1923085068
No known key found for this signature in database
GPG key ID: EEC61A7B4C667D77
2 changed files with 12 additions and 0 deletions

View file

@ -38,6 +38,7 @@ const { directAuth } = mendeleyAPIUtils;
const Zotero_Import_Wizard = { // eslint-disable-line no-unused-vars
file: null,
folder: null,
isZotfileInstalled: false,
libraryID: null,
mendeleyAuth: null,
mendeleyCode: null,
@ -69,6 +70,9 @@ const Zotero_Import_Wizard = { // eslint-disable-line no-unused-vars
this.mendeleyHasPreviouslyImported = !!(await Zotero.DB.valueQueryAsync(relSQL, predicateID));
}
const extensions = await Zotero.getInstalledExtensions();
this.isZotfileInstalled = !!extensions.find(extName => extName.match(/^ZotFile((?!disabled).)*$/));
this.wizard = document.getElementById('import-wizard');
this.wizard.getPageById('page-start')
.addEventListener('pageadvanced', this.onImportSourceAdvance.bind(this));
@ -272,6 +276,13 @@ const Zotero_Import_Wizard = { // eslint-disable-line no-unused-vars
case 'mendeleyOnline':
this.file = null;
this.folder = null;
if (this.isZotfileInstalled) {
this.skipToDonePage(
'general-error',
['import-online-blocked-by-plugin', { plugin: 'ZotFile' }]
);
return;
}
this.wizard.goTo('page-mendeley-online-intro');
this.wizard.canRewind = true;
break;

View file

@ -60,6 +60,7 @@ import-online-intro=In the next step you will be asked to log in to { $targetApp
import-online-intro2={ -app-name } will never see or store your { $targetApp } password.
import-online-form-intro = Please enter your credentials to log in to { $targetAppOnline }. This is necessary to import your { $targetApp } library into { -app-name }.
import-online-wrong-credentials = Login to { $targetApp } failed. Please re-enter credentials and try again.
import-online-blocked-by-plugin = The import cannot continue with { $plugin } installed. Please disable this plugin and try again.
report-error =
.label = Report Error…