aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-08-28 14:22:16 -0400
committerGitHub <noreply@github.com>2021-08-28 14:22:16 -0400
commit74709296e557dfeab2e465f8bd53681934fe8040 (patch)
tree7b5603ad6da96697edc8934159a3d7b42d466a66 /ext/js/pages
parent93f193c89eea381046f00f3a586beb66b2de0b19 (diff)
Dictionary database worker refactoring (#1913)
* Rename DictionaryWorker => DictionaryWorkerHandler * Rename var * Rename file * Simplify * Rename DictionaryDatabaseModifier => DictionaryWorker * Rename dictionary-database-modifier.js => dictionary-worker.js
Diffstat (limited to 'ext/js/pages')
-rw-r--r--ext/js/pages/settings/dictionary-controller.js5
-rw-r--r--ext/js/pages/settings/dictionary-import-controller.js5
2 files changed, 4 insertions, 6 deletions
diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js
index a041e791..2a44f9ad 100644
--- a/ext/js/pages/settings/dictionary-controller.js
+++ b/ext/js/pages/settings/dictionary-controller.js
@@ -16,7 +16,7 @@
*/
/* global
- * DictionaryDatabaseModifier
+ * DictionaryWorker
*/
class DictionaryEntry {
@@ -679,8 +679,7 @@ class DictionaryController {
}
async _deleteDictionaryInternal(dictionaryTitle, onProgress) {
- const dictionaryDatabaseModifier = new DictionaryDatabaseModifier();
- await dictionaryDatabaseModifier.deleteDictionary(dictionaryTitle, onProgress);
+ await new DictionaryWorker().deleteDictionary(dictionaryTitle, onProgress);
yomichan.api.triggerDatabaseUpdated('dictionary', 'delete');
}
diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js
index 2716756d..b6700c78 100644
--- a/ext/js/pages/settings/dictionary-import-controller.js
+++ b/ext/js/pages/settings/dictionary-import-controller.js
@@ -17,7 +17,7 @@
/* global
* DictionaryController
- * DictionaryDatabaseModifier
+ * DictionaryWorker
*/
class DictionaryImportController {
@@ -213,8 +213,7 @@ class DictionaryImportController {
async _importDictionary(file, importDetails, onProgress) {
const archiveContent = await this._readFile(file);
- const dictionaryDatabaseModifier = new DictionaryDatabaseModifier();
- const {result, errors} = await dictionaryDatabaseModifier.importDictionary(archiveContent, importDetails, onProgress);
+ const {result, errors} = await new DictionaryWorker().importDictionary(archiveContent, importDetails, onProgress);
yomichan.api.triggerDatabaseUpdated('dictionary', 'import');
const errors2 = await this._addDictionarySettings(result.sequenced, result.title);