mirror of https://github.com/BTCPrivate/copay.git
Disable Sendform when sending a transaction
This commit is contained in:
parent
112c1adc11
commit
575e99b490
|
@ -183,35 +183,33 @@ angular.module('copayApp.controllers').controller('SendController',
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
$scope.creatingTX = true;
|
|
||||||
if ($scope.isWindowsPhoneApp)
|
if ($scope.isWindowsPhoneApp)
|
||||||
$rootScope.wpInputFocused = true;
|
$rootScope.wpInputFocused = true;
|
||||||
|
|
||||||
$timeout(function () {
|
$timeout(function () {
|
||||||
var comment = form.comment.$modelValue;
|
var comment = form.comment.$modelValue;
|
||||||
var merchantData = $scope._merchantData;
|
var merchantData = $scope._merchantData;
|
||||||
var address, amount;
|
var address, amount;
|
||||||
if (!merchantData) {
|
if (!merchantData) {
|
||||||
address = form.address.$modelValue;
|
address = form.address.$modelValue;
|
||||||
amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0));
|
amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
w.spend({
|
w.spend({
|
||||||
merchantData: merchantData,
|
merchantData: merchantData,
|
||||||
toAddress: address,
|
toAddress: address,
|
||||||
amountSat: amount,
|
amountSat: amount,
|
||||||
comment: comment,
|
comment: comment,
|
||||||
}, function (err, txid, status) {
|
}, function (err, txid, status) {
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
$scope.creatingTX = false;
|
if ($scope.isWindowsPhoneApp)
|
||||||
if ($scope.isWindowsPhoneApp)
|
$rootScope.wpInputFocused = false;
|
||||||
$rootScope.wpInputFocused = false;
|
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
return $scope.setError(err);
|
return $scope.setError(err);
|
||||||
txStatus.notify(status);
|
txStatus.notify(status);
|
||||||
$scope.resetForm();
|
$scope.resetForm();
|
||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="send" ng-controller="SendController" ng-init="init()">
|
<div class="send" ng-controller="SendController" ng-init="init()">
|
||||||
<div class="columns" ng-show="$root.wallet.balanceInfo.lockedBalance && !walletSelection">
|
<div class="columns" ng-show="$root.wallet.balanceInfo.lockedBalance">
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<i class="fi-info size-42 m10r"></i>
|
<i class="fi-info size-42 m10r"></i>
|
||||||
|
@ -32,25 +32,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" ng-show="creatingTX">
|
<div class="row" ng-show="!fetchingURL">
|
||||||
<div class="large-12 columns">
|
|
||||||
<div class="panel">
|
|
||||||
<div class="box-notification">
|
|
||||||
<div class="box-icon secondary">
|
|
||||||
<i class="fi-bitcoin-circle icon-rotate spinner size-24"></i>
|
|
||||||
</div>
|
|
||||||
<span class="text-secondary size-14">
|
|
||||||
Creating Transaction...
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row" ng-show="!fetchingURL && !creatingTX">
|
|
||||||
<div class="large-8 large-centered columns">
|
<div class="large-8 large-centered columns">
|
||||||
<form name="sendForm" ng-submit="submitForm(sendForm)" novalidate>
|
<form name="sendForm" ng-submit="submitForm(sendForm)" ng-disabled="loading" novalidate>
|
||||||
<div class="panel">
|
<div class="panel">
|
||||||
<div class="box-notification" ng-show="error && !hideForWP ">
|
<div class="box-notification" ng-show="error && !hideForWP ">
|
||||||
<div class="box-icon error">
|
<div class="box-icon error">
|
||||||
|
@ -159,7 +143,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="large-6 medium-6 small-12 columns text-right">
|
<div class="large-6 medium-6 small-12 columns text-right">
|
||||||
<button type="submit" class="button primary expand" ng-disabled="sendForm.$invalid || loading">
|
<button type="submit" class="button primary expand" ng-disabled="sendForm.$invalid || loading">
|
||||||
<i class="fi-bitcoin-circle icon-rotate spinner" ng-show="loading"></i> Send
|
Send
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="large-4 medium-4 small-12 columns text-left">
|
<div class="large-4 medium-4 small-12 columns text-left">
|
||||||
|
@ -171,7 +155,8 @@
|
||||||
<a translate class="button radius tiny warning" ng-click="cancelScanner()"><i class="fi-x size-18"></i> </a>
|
<a translate class="button radius tiny warning" ng-click="cancelScanner()"><i class="fi-x size-18"></i> </a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a ng-click="resetForm()" class="button expand warning m0" ng-show="_merchantData || lockAddress" ng-disabled="loading">Cancel</a>
|
<a ng-click="resetForm()" class="button expand warning m0"
|
||||||
|
ng-show="(_merchantData || lockAddress) && !loading">Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue