From 01c5c5c04bd9234c64d6f57ee0ea65b0f478a1b7 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sat, 31 Jul 2021 18:08:51 -0400 Subject: Dictionary importer refactoring (#1867) * Remove map of schemas * Don't reuse dictionary importer instances * Refactor * Update how progress callback is used --- ext/js/language/dictionary-importer-worker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/js/language/dictionary-importer-worker.js') diff --git a/ext/js/language/dictionary-importer-worker.js b/ext/js/language/dictionary-importer-worker.js index f44a10f9..014b6542 100644 --- a/ext/js/language/dictionary-importer-worker.js +++ b/ext/js/language/dictionary-importer-worker.js @@ -64,8 +64,8 @@ class DictionaryImporterWorker { async _importDictionary(archiveContent, importDetails, onProgress) { const dictionaryDatabase = await this._getPreparedDictionaryDatabase(); try { - const dictionaryImporter = new DictionaryImporter(this._mediaLoader); - const {result, errors} = await dictionaryImporter.importDictionary(dictionaryDatabase, archiveContent, importDetails, onProgress); + const dictionaryImporter = new DictionaryImporter(this._mediaLoader, onProgress); + const {result, errors} = await dictionaryImporter.importDictionary(dictionaryDatabase, archiveContent, importDetails); return { result, errors: errors.map((error) => serializeError(error)) -- cgit v1.2.3