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/pages/settings/dictionary-import-controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/js/pages/settings') diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js index 5e51a48a..b18eeb6b 100644 --- a/ext/js/pages/settings/dictionary-import-controller.js +++ b/ext/js/pages/settings/dictionary-import-controller.js @@ -181,9 +181,9 @@ class DictionaryImportController { } async _importDictionary(file, importDetails, onProgress) { - const dictionaryImporter = new DictionaryImporterThreaded(); + const dictionaryImporter = new DictionaryImporterThreaded(onProgress); const archiveContent = await this._readFile(file); - const {result, errors} = await dictionaryImporter.importDictionary(archiveContent, importDetails, onProgress); + const {result, errors} = await dictionaryImporter.importDictionary(archiveContent, importDetails); yomichan.api.triggerDatabaseUpdated('dictionary', 'import'); const errors2 = await this._addDictionarySettings(result.sequenced, result.title); -- cgit v1.2.3