diff options
author | Alex Yatskov <alex@foosoft.net> | 2016-10-19 20:57:08 -0700 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2016-10-19 20:57:08 -0700 |
commit | 7618b8e90904e354f43d3447363e2c5a1f98d357 (patch) | |
tree | 89a0a7fb7141eca2e7b73868d4dc3da8eb08cf4c /ext/fg | |
parent | 055174efd2955464b21c653bfa3ed889e9d03e69 (diff) |
Cleanup
Diffstat (limited to 'ext/fg')
-rw-r--r-- | ext/fg/js/util.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/fg/js/util.js b/ext/fg/js/util.js index cf5621ec..7248ae86 100644 --- a/ext/fg/js/util.js +++ b/ext/fg/js/util.js @@ -18,7 +18,15 @@ function invokeApiBg(action, params) { - return new Promise((resolve, reject) => chrome.runtime.sendMessage({action, params}, resolve)); + return new Promise((resolve, reject) => { + chrome.runtime.sendMessage({action, params}, (result, error) => { + if (error) { + reject(error); + } else { + resolve(result); + } + }); + }); } function getEnabled() { |