diff --git a/js/controllers/home.js b/js/controllers/home.js index 85bd6f671..2f0a87b12 100644 --- a/js/controllers/home.js +++ b/js/controllers/home.js @@ -10,6 +10,6 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc return; } $scope.loading = true; - identityService.open($scope, form); + identityService.open($scope, form); } }); diff --git a/js/models/Identity.js b/js/models/Identity.js index 072d9eecf..110e17553 100644 --- a/js/models/Identity.js +++ b/js/models/Identity.js @@ -261,8 +261,8 @@ Identity.prototype.close = function(cb) { * @param {string} cypherText - the encrypted object * @param {string} passphrase - passphrase to decrypt it * @param {string[]} opts.skipFields - fields to ignore when importing - * @param {string[]} opts.salt - - * @param {string[]} opts.iterations - + * @param {string[]} opts.salt - + * @param {string[]} opts.iterations - * @param {string[]} opts.importFunction - for stubbing * @return {Wallet} */ diff --git a/js/plugins/EncryptedInsightStorage.js b/js/plugins/EncryptedInsightStorage.js index 3cecb13f0..6e759f794 100644 --- a/js/plugins/EncryptedInsightStorage.js +++ b/js/plugins/EncryptedInsightStorage.js @@ -16,7 +16,7 @@ EncryptedInsightStorage.prototype.getItem = function(name, callback) { } var decryptedJson = cryptoUtil.decrypt(key, body); if (!decryptedJson) { - return callback('Internal Error'); + return callback('PNOTFOUND'); } return callback(null, decryptedJson); } diff --git a/js/plugins/EncryptedLocalStorage.js b/js/plugins/EncryptedLocalStorage.js index 815a28cde..698e999d6 100644 --- a/js/plugins/EncryptedLocalStorage.js +++ b/js/plugins/EncryptedLocalStorage.js @@ -9,13 +9,15 @@ inherits(EncryptedLocalStorage, LocalStorage); EncryptedLocalStorage.prototype.getItem = function(name, callback) { var key = cryptoUtil.kdf(this.password + this.email); - LocalStorage.prototype.getItem.apply(this, [name, function(err, body) { - var decryptedJson = cryptoUtil.decrypt(key, body); - if (!decryptedJson) { - return callback('Internal Error'); + LocalStorage.prototype.getItem.apply(this, [name, + function(err, body) { + var decryptedJson = cryptoUtil.decrypt(key, body); + if (!decryptedJson) { + return callback('PNOTFOUND'); + } + return callback(null, decryptedJson); } - return callback(null, decryptedJson); - }]); + ]); }; EncryptedLocalStorage.prototype.setItem = function(name, value, callback) { diff --git a/js/services/identityService.js b/js/services/identityService.js index 9ba288a81..fcf876a1a 100644 --- a/js/services/identityService.js +++ b/js/services/identityService.js @@ -25,7 +25,6 @@ angular.module('copayApp.services') }; iden.createWallet(walletOptions, function(err, wallet) { if (err) { - console.log('Error:' + err) controllerUtils.onErrorDigest( scope, 'Could not create default wallet'); } else { @@ -53,9 +52,8 @@ angular.module('copayApp.services') passphraseConfig: config.passphraseConfig, }, function(err, iden) { if (err && !iden) { - console.log('Error:' + err) controllerUtils.onErrorDigest( - scope, (err.toString() || '').match('PNOTFOUND') ? 'Profile not found' : 'Unknown error'); + scope, (err.toString() || '').match('PNOTFOUND') ? 'Invalid email or password' : 'Unknown error'); } else { var firstWallet = iden.getLastFocusedWallet(); controllerUtils.bindProfile(scope, iden, firstWallet); diff --git a/js/services/notifications.js b/js/services/notifications.js index d69658382..3f5b324ea 100644 --- a/js/services/notifications.js +++ b/js/services/notifications.js @@ -185,6 +185,7 @@ factory('notification', ['$timeout', 'timestamp': +new Date(), 'userData': userData }; + notifications.push(notification); if (settings.html5Mode) { @@ -193,7 +194,10 @@ factory('notification', ['$timeout', }, function() { // inner on close function }); - } else { + } + + //this is done because html5Notify() changes the variable settings.html5Mode + if (!settings.html5Mode) { queue.push(notification); $timeout(function removeFromQueueTimeout() { queue.splice(queue.indexOf(notification), 1); @@ -202,11 +206,14 @@ factory('notification', ['$timeout', // Mobile notification if (window && window.navigator && window.navigator.vibrate) { - window.navigator.vibrate([200,100,200]); + window.navigator.vibrate([200, 100, 200]); }; if (document.hidden && (type == 'info' || type == 'funds')) { - new window.Notification(title, {body: content, icon:'img/notification.png'}); + new window.Notification(title, { + body: content, + icon: 'img/notification.png' + }); } this.save(); @@ -234,8 +241,7 @@ factory('notification', ['$timeout', }; } -]). -directive('notifications', function(notification, $compile) { +]).directive('notifications', function(notification, $compile) { /** * * It should also parse the arguments passed to it that specify