diff --git a/chrome/content/zotero/import/mendeley/mendeleyImport.js b/chrome/content/zotero/import/mendeley/mendeleyImport.js index 1509212d69..69746da5d0 100644 --- a/chrome/content/zotero/import/mendeley/mendeleyImport.js +++ b/chrome/content/zotero/import/mendeley/mendeleyImport.js @@ -11,7 +11,7 @@ Services.scriptloader.loadSubScript("chrome://zotero/content/import/mendeley/men const importerVersion = 1; const { apiTypeToDBType, apiFieldToDBField } = mendeleyOnlineMappings; -const { apiFetch, codeAuth, directAuth, get, getAll } = mendeleyAPIUtils; +const { apiFetch, codeAuth, get, getAll } = mendeleyAPIUtils; const colorMap = new Map(); colorMap.set('rgb(255, 245, 173)', '#ffd400'); @@ -140,7 +140,7 @@ Zotero_Import_Mendeley.prototype.translate = async function (options = {}) { this._itemDone(); let folderKeys = new Map(); - if(!this.relinkOnly) { + if (!this.relinkOnly) { const folders = this._tokens ? await this._getFoldersAPI(mendeleyGroupID) : await this._getFoldersDB(mendeleyGroupID); @@ -182,12 +182,14 @@ Zotero_Import_Mendeley.prototype.translate = async function (options = {}) { this._interruptChecker(true); + // eslint-disable-next-line multiline-ternary let collections = this.relinkOnly ? new Map() : this._tokens ? await this._getDocumentCollectionsAPI(documents, rootCollectionKey, folderKeys) : await this._getDocumentCollectionsDB(mendeleyGroupID, documents, rootCollectionKey, folderKeys); this._interruptChecker(true); + // eslint-disable-next-line multiline-ternary let files = this.relinkOnly ? new Map() : this._tokens ? await this._getDocumentFilesAPI(documents) : await this._getDocumentFilesDB(mendeleyGroupID); @@ -562,7 +564,7 @@ Zotero_Import_Mendeley.prototype._getDocumentsAPI = async function (groupID) { } - return (await getAll(this._tokens, 'documents', params, headers, {}, this._interruptChecker)).map(d => { + return (await getAll(this._tokens, 'documents', params, headers, {}, this._interruptChecker)).map((d) => { const processedDocument = { ...d, remoteUuid: d.id }; try { diff --git a/chrome/locale/en-US/zotero/zotero.ftl b/chrome/locale/en-US/zotero/zotero.ftl index 8340988b4a..0a66d12d89 100644 --- a/chrome/locale/en-US/zotero/zotero.ftl +++ b/chrome/locale/en-US/zotero/zotero.ftl @@ -47,11 +47,13 @@ general-error = Error file-interface-import-error = An error occurred while trying to import the selected file. Please ensure that the file is valid and try again. file-interface-import-complete = Import Complete file-interface-items-were-imported = { $numItems -> - [one] item was imported + [0] No items were imported + [one] One item was imported *[other] { $numItems } items were imported } file-interface-items-were-relinked = { $numRelinked -> - [one] item was relinked + [0] No items were relinked + [one] One item was relinked *[other] { $numRelinked } items were relinked }