diff options
Diffstat (limited to 'ext/bg')
-rw-r--r-- | ext/bg/js/api.js | 7 | ||||
-rw-r--r-- | ext/bg/js/backend.js | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js index 4c55c6e3..3e821333 100644 --- a/ext/bg/js/api.js +++ b/ext/bg/js/api.js @@ -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) { diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 74cd2ab4..5753e16e 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -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}) { |