Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecelia Wren committed May 3, 2018
1 parent 1e682ee commit ff2ed6f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Expand Up @@ -17,7 +17,7 @@
"tests"
],
"dependencies": {
"angular": "~1.3.15",
"angular": "~1.6.9",
"bootstrap": "~3.3.4",
"jquery": "~2.1.3",
"angular-route": "~1.3.15",
Expand Down
15 changes: 9 additions & 6 deletions js/ExtensionStorage.js
@@ -1,22 +1,25 @@
function ExtensionStorage() {
function errorCB(callback) {
return callback();
}
this.getLocal = function (key, callback) {
browser.storage.local.get(key).then(callback)
browser.storage.local.get(key).then(callback, errorCB.bind(this, callback))
};
this.setLocal = function (data, callback) {
browser.storage.local.set(data).then(callback)
browser.storage.local.set(data).then(callback, errorCB.bind(this, callback))
};
this.getSync = function (key, callback) {
if (browser.storage.sync) {
browser.storage.sync.get(key).then(callback)
browser.storage.sync.get(key).then(callback, errorCB.bind(this, callback))
} else {
browser.storage.local.get(key).then(callback)
browser.storage.local.get(key).then(callback, errorCB.bind(this, callback))
}
};
this.setSync = function (data, callback) {
if (browser.storage.sync) {
browser.storage.sync.set(data).then(callback)
browser.storage.sync.set(data).then(callback, errorCB.bind(this, callback))
} else {
browser.storage.local.set(data).then(callback)
browser.storage.local.set(data).then(callback, errorCB.bind(this, callback))
}
}
}
6 changes: 4 additions & 2 deletions js/blockchain.js
Expand Up @@ -241,9 +241,11 @@ function saveBlockingReceipts() {
}
function getProtectedUsers(callback) {
storage.getSync("protectedUsers",function(items) {
var users = items.protectedUsers;
if (typeof users === "undefined")
var users;
if (!items || !items.protectedUsers)
users = {};
else
users = items.protectedUsers;
callback(users);
});
}
Expand Down

0 comments on commit ff2ed6f

Please sign in to comment.