mirror of https://github.com/BTCPrivate/copay.git
Merge remote-tracking branch 'cmgustavo/bug/04-angular-issues'
This commit is contained in:
commit
6755ff2843
|
@ -45,9 +45,10 @@ angular.module('copayApp.directives')
|
||||||
link: function(scope, element, attrs, ctrl) {
|
link: function(scope, element, attrs, ctrl) {
|
||||||
var val = function(value) {
|
var val = function(value) {
|
||||||
var availableBalanceNum = Number(($rootScope.availableBalance * config.unitToSatoshi).toFixed(0));
|
var availableBalanceNum = Number(($rootScope.availableBalance * config.unitToSatoshi).toFixed(0));
|
||||||
var vNum = Number((value * config.unitToSatoshi).toFixed(0)) + feeSat;
|
var vNum = Number((value * config.unitToSatoshi).toFixed(0));
|
||||||
|
|
||||||
if (typeof vNum == "number" && vNum > 0) {
|
if (typeof vNum == "number" && vNum > 0) {
|
||||||
|
vNum = vNum + feeSat;
|
||||||
if (availableBalanceNum < vNum || isNaN(availableBalanceNum)) {
|
if (availableBalanceNum < vNum || isNaN(availableBalanceNum)) {
|
||||||
ctrl.$setValidity('enoughAmount', false);
|
ctrl.$setValidity('enoughAmount', false);
|
||||||
scope.notEnoughAmount = true;
|
scope.notEnoughAmount = true;
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
<input type="number" id="alternative_amount"
|
<input type="number" id="alternative_amount"
|
||||||
ng-disabled="loading || !isRateAvailable "
|
ng-disabled="loading || !isRateAvailable "
|
||||||
name="alternative" placeholder="Amount" ng-model="alternative"
|
name="alternative" placeholder="Amount" ng-model="alternative"
|
||||||
enough-amount required
|
required
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue