check if your balance is enough to send money

This commit is contained in:
Gustavo Cortez 2014-04-21 11:34:08 -03:00
parent c93f1eb232
commit e03b0db150
1 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,11 @@ angular.module('copay.send').controller('SendController',
return;
}
if ($rootScope.totalBalance <= form.amount.$modelValue) {
$rootScope.flashMessage = { message: 'You have not enough amount to send', type: 'error'};
return;
}
var address = form.address.$modelValue;
var amount = (form.amount.$modelValue * 100000000).toString(); // satoshi to string