diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-09-07 16:15:18 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-09-10 20:09:33 -0400 |
commit | 05ce350792fd60c1721bff4d0fb971e2bec24818 (patch) | |
tree | e9f55d8dd038fd3beaacae98a2a4c748aff1400b /ext/bg/js/options.js | |
parent | 4686a31a0a5d30a1b01e3cd2b689d1950c79c940 (diff) |
Use apiOptionsSave instead of optionsSave
Diffstat (limited to 'ext/bg/js/options.js')
-rw-r--r-- | ext/bg/js/options.js | 13 |
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(); + } + }); }); } |