summaryrefslogtreecommitdiff
path: root/ext/fg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fg/js')
-rw-r--r--ext/fg/js/util.js10
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() {