diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-03-30 20:45:36 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2020-03-30 20:45:36 -0400 |
commit | 02f7763f004790a432302637586a876291e32f61 (patch) | |
tree | 4df392b9314b00e12e833012ebbfd7bea73922be /ext/bg/js | |
parent | c193a703cc1444fbc75e62954ca3a10210ad95d0 (diff) |
Add importDictionary function to Backend
Diffstat (limited to 'ext/bg/js')
-rw-r--r-- | ext/bg/js/backend.js | 4 | ||||
-rw-r--r-- | ext/bg/js/util.js | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index dd666b0d..3ef7c62c 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -299,6 +299,10 @@ class Backend { return true; } + async importDictionary(archiveSource, onProgress, details) { + return await this.translator.database.importDictionary(archiveSource, onProgress, details); + } + // Message handlers _onApiYomichanCoreReady(_params, sender) { diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index 79c6af06..a7ed4a34 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -118,7 +118,7 @@ async function utilDatabaseDeleteDictionary(dictionaryName, onProgress) { async function utilDatabaseImport(data, onProgress, details) { data = await utilReadFile(data); - return utilIsolate(await utilBackend().translator.database.importDictionary( + return utilIsolate(await utilBackend().importDictionary( utilBackgroundIsolate(data), utilBackgroundFunctionIsolate(onProgress), utilBackgroundIsolate(details) |