paypro: better notification if the user has insufficient funds for a PP tx.

This commit is contained in:
Christopher Jeffrey 2014-08-13 20:29:02 -04:00 committed by Manuel Araoz
commit eea59bc0e1

View file

@ -425,11 +425,16 @@ angular.module('copayApp.controllers').controller('SendController',
if (merchantData && available < +merchantData.total) {
err = new Error('No unspent outputs available.');
scope.notEnoughAmount = true;
scope.sendForm.amount.$isValid = false;
}
if (err) {
scope.sendForm.address.$isValid = false;
notification.error('Error', err.message || 'Bad payment server.');
if ($rootScope.$$phase !== '$apply' && $rootScope.$$phase !== '$digest') {
$rootScope.$apply();
}
return;
}