mirror of https://github.com/BTCPrivate/copay.git
paypro: better error display on no unspent outputs.
This commit is contained in:
parent
8e86826b68
commit
ea7948f420
|
@ -430,13 +430,29 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
|
||||
if (err) {
|
||||
scope.sendForm.address.$isValid = false;
|
||||
|
||||
if (err.amount) {
|
||||
scope.sendForm.amount.$setViewValue(+err.amount / config.unitToSatoshi);
|
||||
scope.sendForm.amount.$render();
|
||||
scope.sendForm.amount.$isValid = false;
|
||||
scope.notEnoughAmount = true;
|
||||
$rootScope.merchantError = true;
|
||||
var lastAddr = scope.sendForm.address.$viewValue;
|
||||
var unregister = scope.$watch('address', function() {
|
||||
if (scope.sendForm.address.$viewValue !== lastAddr) {
|
||||
delete $rootScope.merchantError;
|
||||
scope.sendForm.amount.$setViewValue('');
|
||||
scope.sendForm.amount.$render();
|
||||
unregister();
|
||||
if ($rootScope.$$phase !== '$apply' && $rootScope.$$phase !== '$digest') {
|
||||
$rootScope.$apply();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
notification.error('Error', err.message || 'Bad payment server.');
|
||||
|
||||
if ($rootScope.$$phase !== '$apply' && $rootScope.$$phase !== '$digest') {
|
||||
$rootScope.$apply();
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
</label>
|
||||
<div class="small-9 columns">
|
||||
<input type="number" id="amount"
|
||||
ng-disabled="loading || ($root.merchant && +$root.merchant.total > 0)"
|
||||
ng-disabled="loading || ($root.merchant && +$root.merchant.total > 0) || $root.merchantError"
|
||||
name="amount" placeholder="Amount" ng-model="amount"
|
||||
min="0.00005400" max="10000000000" enough-amount required
|
||||
autocomplete="off"
|
||||
|
|
Loading…
Reference in New Issue