Skip to content

Commit

Permalink
Added error message if dropbox content failed to be loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyran committed Apr 11, 2014
1 parent 9502685 commit 070236b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scripts/OnePassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

Q.all([this.getContents(), this.getEncryptionKeys()]).then(function () {
deferred.resolve();
}, function () {
deferred.reject();
});

return deferred.promise;
Expand Down Expand Up @@ -73,7 +75,7 @@
keychainItem.decrypt(keychain);
};

var getJson = function (url, cb) {
var getJson = function (url) {
var deferred = Q.defer();

var xhr = new XMLHttpRequest();
Expand All @@ -89,7 +91,7 @@
};

xhr.onerror = function () {
cb(xhr.statusText);
deferred.reject(new Error(xhr.statusText));
};

xhr.send();
Expand Down
2 changes: 2 additions & 0 deletions scripts/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
onepassword = new window.OnePassword(items.baseurl);
onepassword.load().then(function () {
btnUnlock.disabled = false;
}, function () {
error.textContent = "Could not load onepassword data. Make sure you are logged in to dropbox and that the url is correct on the options page.";
});

deferred.resolve(onepassword);
Expand Down
1 change: 0 additions & 1 deletion style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
.error {
text-align: center;
color: #f00;
height: 40px;
margin-top: 10px;
}

Expand Down

0 comments on commit 070236b

Please sign in to comment.