Merge pull request #46 from matiaspando/feature/removeCryptoAES

fixes notification for invalid credentials
This commit is contained in:
Matias Alejo Garcia 2014-10-28 18:23:17 -03:00
commit eaf14ddb49
6 changed files with 24 additions and 18 deletions

View file

@ -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);

View file

@ -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