Add importDictionary function to Backend

This commit is contained in:
toasted-nutbread 2020-03-30 20:45:36 -04:00
parent c193a703cc
commit 02f7763f00
2 changed files with 5 additions and 1 deletions

View File

@ -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) {

View File

@ -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)