aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/options.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-07 16:15:18 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-10 20:09:33 -0400
commit05ce350792fd60c1721bff4d0fb971e2bec24818 (patch)
treee9f55d8dd038fd3beaacae98a2a4c748aff1400b /ext/bg/js/options.js
parent4686a31a0a5d30a1b01e3cd2b689d1950c79c940 (diff)
Use apiOptionsSave instead of optionsSave
Diffstat (limited to 'ext/bg/js/options.js')
-rw-r--r--ext/bg/js/options.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 69c662e6..ea8f56d5 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -343,9 +343,14 @@ function optionsLoad() {
}
function optionsSave(options) {
- return new Promise((resolve) => {
- chrome.storage.local.set({options: JSON.stringify(options)}, resolve);
- }).then(() => {
- utilBackend().onOptionsUpdated(options);
+ return new Promise((resolve, reject) => {
+ chrome.storage.local.set({options: JSON.stringify(options)}, () => {
+ const error = chrome.runtime.lastError;
+ if (error) {
+ reject(error);
+ } else {
+ resolve();
+ }
+ });
});
}