summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/dictionary-import-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/settings/dictionary-import-controller.js')
-rw-r--r--ext/bg/js/settings/dictionary-import-controller.js9
1 files changed, 1 insertions, 8 deletions
diff --git a/ext/bg/js/settings/dictionary-import-controller.js b/ext/bg/js/settings/dictionary-import-controller.js
index b10c87d0..cce695d0 100644
--- a/ext/bg/js/settings/dictionary-import-controller.js
+++ b/ext/bg/js/settings/dictionary-import-controller.js
@@ -110,8 +110,6 @@ class DictionaryImportController {
if (errors.length > 0) {
this._showErrors(errors);
}
-
- this._triggerDatabaseUpdated('purge');
} catch (error) {
this._showErrors([error]);
} finally {
@@ -178,6 +176,7 @@ class DictionaryImportController {
const dictionaryImporter = new DictionaryImporter();
const archiveContent = await this._readFile(file);
const {result, errors} = await dictionaryImporter.importDictionary(dictionaryDatabase, archiveContent, importDetails, onProgress);
+ api.triggerDatabaseUpdated('dictionary', 'import');
const errors2 = await this._addDictionarySettings(result.sequenced, result.title);
if (errors.length > 0) {
@@ -185,8 +184,6 @@ class DictionaryImportController {
allErrors.push(new Error(`Dictionary may not have been imported properly: ${allErrors.length} error${allErrors.length === 1 ? '' : 's'} reported.`));
this._showErrors(allErrors);
}
-
- this._triggerDatabaseUpdated('import');
} finally {
dictionaryDatabase.close();
}
@@ -271,10 +268,6 @@ class DictionaryImportController {
this._errorContainer.hidden = true;
}
- _triggerDatabaseUpdated(cause) {
- this._settingsController.triggerDatabaseUpdated(cause);
- }
-
_readFile(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();