Move apiOptionsSave implementation into Backend
This commit is contained in:
parent
6a1cfbaad6
commit
8dff73679e
@ -29,11 +29,8 @@ function apiOptionsGetFull() {
|
|||||||
return utilBackend()._onApiOptionsGetFull();
|
return utilBackend()._onApiOptionsGetFull();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function apiOptionsSave(source) {
|
function apiOptionsSave(source) {
|
||||||
const backend = utilBackend();
|
return utilBackend()._onApiOptionsSave({source});
|
||||||
const options = await apiOptionsGetFull();
|
|
||||||
await optionsSave(options);
|
|
||||||
backend.onOptionsUpdated(source);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function apiTermsFind(text, details, optionsContext) {
|
async function apiTermsFind(text, details, optionsContext) {
|
||||||
|
@ -234,8 +234,10 @@ class Backend {
|
|||||||
await this._optionsSave({source});
|
await this._optionsSave({source});
|
||||||
}
|
}
|
||||||
|
|
||||||
_onApiOptionsSave({source}) {
|
async _onApiOptionsSave({source}) {
|
||||||
return apiOptionsSave(source);
|
const options = await this.getFullOptions();
|
||||||
|
await optionsSave(options);
|
||||||
|
this.onOptionsUpdated(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onApiKanjiFind({text, optionsContext}) {
|
_onApiKanjiFind({text, optionsContext}) {
|
||||||
|
Loading…
Reference in New Issue
Block a user