summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/profiles.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-11 21:11:07 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-13 23:11:56 -0500
commitb1f72905cf70a9ddb94f033cae0cb7cc03468e21 (patch)
tree6d425cd504eef79dc3b53cb35e79b5ac48f733fd /ext/bg/js/settings/profiles.js
parent17277a645020bf13bef9aaf1c1292f2b1a7cea02 (diff)
Add functions for modifying mutable options
Diffstat (limited to 'ext/bg/js/settings/profiles.js')
-rw-r--r--ext/bg/js/settings/profiles.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/bg/js/settings/profiles.js b/ext/bg/js/settings/profiles.js
index 8c218e97..946d6944 100644
--- a/ext/bg/js/settings/profiles.js
+++ b/ext/bg/js/settings/profiles.js
@@ -27,7 +27,7 @@ function getOptionsContext() {
async function profileOptionsSetup() {
- const optionsFull = await apiOptionsGetFull();
+ const optionsFull = await getOptionsFullMutable();
currentProfileIndex = optionsFull.profileCurrent;
profileOptionsSetupEventListeners();
@@ -120,7 +120,7 @@ async function profileOptionsUpdateTarget(optionsFull) {
profileFormWrite(optionsFull);
const optionsContext = getOptionsContext();
- const options = await apiOptionsGet(optionsContext);
+ const options = await getOptionsMutable(optionsContext);
await formWrite(options);
}
@@ -164,13 +164,13 @@ async function onProfileOptionsChanged(e) {
return;
}
- const optionsFull = await apiOptionsGetFull();
+ const optionsFull = await getOptionsFullMutable();
await profileFormRead(optionsFull);
await settingsSaveOptions();
}
async function onTargetProfileChanged() {
- const optionsFull = await apiOptionsGetFull();
+ const optionsFull = await getOptionsFullMutable();
const index = tryGetIntegerValue('#profile-target', 0, optionsFull.profiles.length);
if (index === null || currentProfileIndex === index) {
return;
@@ -182,7 +182,7 @@ async function onTargetProfileChanged() {
}
async function onProfileAdd() {
- const optionsFull = await apiOptionsGetFull();
+ const optionsFull = await getOptionsFullMutable();
const profile = utilBackgroundIsolate(optionsFull.profiles[currentProfileIndex]);
profile.name = profileOptionsCreateCopyName(profile.name, optionsFull.profiles, 100);
optionsFull.profiles.push(profile);
@@ -210,7 +210,7 @@ async function onProfileRemove(e) {
async function onProfileRemoveConfirm() {
$('#profile-remove-modal').modal('hide');
- const optionsFull = await apiOptionsGetFull();
+ const optionsFull = await getOptionsFullMutable();
if (optionsFull.profiles.length <= 1) {
return;
}
@@ -234,7 +234,7 @@ function onProfileNameChanged() {
}
async function onProfileMove(offset) {
- const optionsFull = await apiOptionsGetFull();
+ const optionsFull = await getOptionsFullMutable();
const index = currentProfileIndex + offset;
if (index < 0 || index >= optionsFull.profiles.length) {
return;
@@ -267,7 +267,7 @@ async function onProfileCopy() {
async function onProfileCopyConfirm() {
$('#profile-copy-modal').modal('hide');
- const optionsFull = await apiOptionsGetFull();
+ const optionsFull = await getOptionsFullMutable();
const index = tryGetIntegerValue('#profile-copy-source', 0, optionsFull.profiles.length);
if (index === null || index === currentProfileIndex) {
return;