diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-12-11 21:11:07 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-12-13 23:11:56 -0500 |
commit | b1f72905cf70a9ddb94f033cae0cb7cc03468e21 (patch) | |
tree | 6d425cd504eef79dc3b53cb35e79b5ac48f733fd /ext/bg/js/settings/main.js | |
parent | 17277a645020bf13bef9aaf1c1292f2b1a7cea02 (diff) |
Add functions for modifying mutable options
Diffstat (limited to 'ext/bg/js/settings/main.js')
-rw-r--r-- | ext/bg/js/settings/main.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/bg/js/settings/main.js b/ext/bg/js/settings/main.js index c5298dd4..315766e0 100644 --- a/ext/bg/js/settings/main.js +++ b/ext/bg/js/settings/main.js @@ -16,6 +16,14 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +function getOptionsMutable(optionsContext) { + return utilBackend().getOptions(optionsContext); +} + +function getOptionsFullMutable() { + return utilBackend().getFullOptions(); +} + async function formRead(options) { options.general.enable = $('#enable').prop('checked'); options.general.showGuide = $('#show-usage-guide').prop('checked'); @@ -164,7 +172,7 @@ function formUpdateVisibility(options) { async function onFormOptionsChanged() { const optionsContext = getOptionsContext(); - const options = await apiOptionsGet(optionsContext); + const options = await getOptionsMutable(optionsContext); await formRead(options); await settingsSaveOptions(); @@ -190,7 +198,7 @@ async function onOptionsUpdate({source}) { if (source === thisSource) { return; } const optionsContext = getOptionsContext(); - const options = await apiOptionsGet(optionsContext); + const options = await getOptionsMutable(optionsContext); await formWrite(options); } |