Move apiOptionsSave implementation into Backend

This commit is contained in:
toasted-nutbread 2019-12-09 21:11:10 -05:00
parent 6a1cfbaad6
commit 8dff73679e
2 changed files with 6 additions and 7 deletions

View File

@ -29,11 +29,8 @@ function apiOptionsGetFull() {
return utilBackend()._onApiOptionsGetFull();
}
async function apiOptionsSave(source) {
const backend = utilBackend();
const options = await apiOptionsGetFull();
await optionsSave(options);
backend.onOptionsUpdated(source);
function apiOptionsSave(source) {
return utilBackend()._onApiOptionsSave({source});
}
async function apiTermsFind(text, details, optionsContext) {

View File

@ -234,8 +234,10 @@ class Backend {
await this._optionsSave({source});
}
_onApiOptionsSave({source}) {
return apiOptionsSave(source);
async _onApiOptionsSave({source}) {
const options = await this.getFullOptions();
await optionsSave(options);
this.onOptionsUpdated(source);
}
_onApiKanjiFind({text, optionsContext}) {