aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2018-03-15 01:31:25 +0800
committerkumavis <aaron@kumavis.me>2018-03-15 01:31:25 +0800
commit481983aae873d1fb7cceef2cb42ec4fb0580368a (patch)
treec2b48deb785d8a505d02e5e41f73c1a9077fa1ea
parent9226de6c9502b78b0558540759b664d9e571996d (diff)
downloadtangerine-wallet-browser-481983aae873d1fb7cceef2cb42ec4fb0580368a.tar.gz
tangerine-wallet-browser-481983aae873d1fb7cceef2cb42ec4fb0580368a.tar.zst
tangerine-wallet-browser-481983aae873d1fb7cceef2cb42ec4fb0580368a.zip
local-store - fix promisification of methods
-rw-r--r--app/scripts/lib/local-store.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/scripts/lib/local-store.js b/app/scripts/lib/local-store.js
index 1cf00dd30..2d6155dbf 100644
--- a/app/scripts/lib/local-store.js
+++ b/app/scripts/lib/local-store.js
@@ -3,7 +3,6 @@
// https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/storage/local
const extension = require('extensionizer')
-const { promisify } = require('util')
module.exports = class ExtensionStore {
constructor() {
@@ -12,8 +11,8 @@ module.exports = class ExtensionStore {
log.error('Storage local API not available.')
}
const local = extension.storage.local
- this._get = promisify(local.get).bind(local)
- this._set = promisify(local.set).bind(local)
+ this._get = function() { return new Promise((resolve) => local.get(resolve)) }
+ this._set = function(state) { return new Promise((resolve) => local.set(state, resolve)) }
}
async get() {