aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-04 17:54:34 -0400
committerGitHub <noreply@github.com>2020-09-04 17:54:34 -0400
commitd8f488e28c7d2eb0cf84611ea2ea9c26ed57cb1f (patch)
treef7f121c9bfa384375d84a5fe4014f782d8421ea2 /ext/bg/js/backend.js
parent8cd5a2f75f192417eee49f221029d50d77aef82d (diff)
Settings dictionary import refactor (#759)
* Fix .purge not re-opening the database after deletion failure * Create DictionaryImportController * Remove backend dictionary import
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js11
1 files changed, 0 insertions, 11 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 7f85d9a5..e9f4f924 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -22,7 +22,6 @@
* AudioUriBuilder
* ClipboardMonitor
* DictionaryDatabase
- * DictionaryImporter
* Environment
* JsonSchemaValidator
* Mecab
@@ -39,7 +38,6 @@ class Backend {
constructor() {
this._environment = new Environment();
this._dictionaryDatabase = new DictionaryDatabase();
- this._dictionaryImporter = new DictionaryImporter();
this._translator = new Translator(this._dictionaryDatabase);
this._anki = new AnkiConnect();
this._mecab = new Mecab();
@@ -130,7 +128,6 @@ class Backend {
['getOrCreateSearchPopup', {async: true, contentScript: true, handler: this._onApiGetOrCreateSearchPopup.bind(this)}]
]);
this._messageHandlersWithProgress = new Map([
- ['importDictionaryArchive', {async: true, contentScript: false, handler: this._onApiImportDictionaryArchive.bind(this)}],
['deleteDictionary', {async: true, contentScript: false, handler: this._onApiDeleteDictionary.bind(this)}]
]);
@@ -755,10 +752,6 @@ class Backend {
return details;
}
- async _onApiImportDictionaryArchive({archiveContent, details}, sender, onProgress) {
- return await this._dictionaryImporter.importDictionary(this._dictionaryDatabase, archiveContent, details, onProgress);
- }
-
async _onApiDeleteDictionary({dictionaryName}, sender, onProgress) {
this._translator.clearDatabaseCaches();
await this._dictionaryDatabase.deleteDictionary(dictionaryName, {rate: 1000}, onProgress);
@@ -1045,10 +1038,6 @@ class Backend {
return true;
}
- async _importDictionary(archiveSource, onProgress, details) {
- return await this._dictionaryImporter.importDictionary(this._dictionaryDatabase, archiveSource, onProgress, details);
- }
-
async _textParseScanning(text, options) {
const results = [];
while (text.length > 0) {