diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-02-14 15:53:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-14 15:53:35 -0500 |
commit | 286534e648af350d24fbf3c7892a7ec81aaeb4bd (patch) | |
tree | 89d88e961c5a0a6f508c66789e30b9ba4a968e73 /ext/js/settings/dictionary-import-controller.js | |
parent | efe8140f103179f50b610f182148b9427af99010 (diff) |
Move api to yomichan object (#1392)
* Move cross frame API from API to Yomichan
* Add API instance to Yomichan
* Move api global to yomichan.api
* Pass yomichan to API
* Remove IIFE
Diffstat (limited to 'ext/js/settings/dictionary-import-controller.js')
-rw-r--r-- | ext/js/settings/dictionary-import-controller.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/js/settings/dictionary-import-controller.js b/ext/js/settings/dictionary-import-controller.js index c4ad9e59..00eb7b95 100644 --- a/ext/js/settings/dictionary-import-controller.js +++ b/ext/js/settings/dictionary-import-controller.js @@ -19,7 +19,6 @@ * DictionaryDatabase * DictionaryImporter * ObjectPropertyAccessor - * api */ class DictionaryImportController { @@ -102,7 +101,7 @@ class DictionaryImportController { this._setSpinnerVisible(true); if (purgeNotification !== null) { purgeNotification.hidden = false; } - await api.purgeDatabase(); + await yomichan.api.purgeDatabase(); const errors = await this._clearDictionarySettings(); if (errors.length > 0) { @@ -197,7 +196,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'); + yomichan.api.triggerDatabaseUpdated('dictionary', 'import'); const errors2 = await this._addDictionarySettings(result.sequenced, result.title); if (errors.length > 0) { |