Move apiOptionsSave implementation into Backend
This commit is contained in:
parent
6a1cfbaad6
commit
8dff73679e
@ -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) {
|
||||
|
@ -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}) {
|
||||
|
Loading…
Reference in New Issue
Block a user