mirror of https://github.com/BTCPrivate/copay.git
Ref confirm. Removes unused code. Fix noLowFee directive
This commit is contained in:
parent
13b8b81e11
commit
748e8a4fbb
|
@ -176,12 +176,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
|
||||
function getTxp(tx, wallet, dryRun, cb) {
|
||||
|
||||
var paypro = tx.paypro;
|
||||
var toAddress = tx.toAddress;
|
||||
var description = tx.description;
|
||||
|
||||
// ToDo: use a credential's (or fc's) function for this
|
||||
if (description && !wallet.credentials.sharedEncryptingKey) {
|
||||
if (tx.description && !wallet.credentials.sharedEncryptingKey) {
|
||||
var msg = gettextCatalog.getString('Could not add message to imported wallet without shared encrypting key');
|
||||
$log.warn(msg);
|
||||
return setSendError(msg);
|
||||
|
@ -208,7 +204,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
txp.feeLevel = tx.feeLevel;
|
||||
}
|
||||
|
||||
txp.message = description;
|
||||
txp.message = tx.description;
|
||||
|
||||
if (tx.paypro) {
|
||||
txp.payProUrl = tx.paypro.url;
|
||||
|
@ -276,6 +272,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
tx.sendMaxInfo = sendMaxInfo;
|
||||
tx.toAmount = tx.sendMaxInfo.amount;
|
||||
updateAmount();
|
||||
showSendMaxWarning(sendMaxInfo);
|
||||
}
|
||||
refresh();
|
||||
|
||||
|
@ -286,9 +283,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
getTxp(lodash.clone(tx), wallet, opts.dryRun, function(err, txp) {
|
||||
if (err) return cb(err);
|
||||
|
||||
if (tx.sendMaxInfo)
|
||||
showSendMaxWarning(sendMaxInfo, function(err) {});
|
||||
|
||||
txp.feeStr = txFormatService.formatAmountStr(txp.fee);
|
||||
txFormatService.formatAlternativeStr(txp.fee, function(v) {
|
||||
txp.alternativeFeeStr = v;
|
||||
|
@ -360,24 +354,6 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
popupService.showAlert(null, msg, function() {});
|
||||
};
|
||||
|
||||
function setSendMaxValues(data) {
|
||||
$scope.amountStr = txFormatService.formatAmountStr(data.amount, true);
|
||||
$scope.displayAmount = getDisplayAmount($scope.amountStr);
|
||||
$scope.displayUnit = getDisplayUnit($scope.amountStr);
|
||||
$scope.fee = txFormatService.formatAmountStr(data.fee);
|
||||
txFormatService.formatAlternativeStr(data.fee, function(v) {
|
||||
$scope.feeFiat = v;
|
||||
});
|
||||
toAmount = parseFloat((data.amount * satToUnit).toFixed(unitDecimals));
|
||||
txFormatService.formatAlternativeStr(data.amount, function(v) {
|
||||
$scope.alternativeAmountStr = v;
|
||||
});
|
||||
$scope.feeRateStr = (data.fee / (data.amount + data.fee) * 100).toFixed(2) + '%';
|
||||
$timeout(function() {
|
||||
$scope.$apply();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.$on('accepted', function(event) {
|
||||
$scope.approve();
|
||||
});
|
||||
|
@ -565,27 +541,19 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
};
|
||||
|
||||
$scope.onSuccessConfirm = function() {
|
||||
var previousView = $ionicHistory.viewHistory().backView && $ionicHistory.viewHistory().backView.stateName;
|
||||
|
||||
$ionicHistory.nextViewOptions({
|
||||
disableAnimate: true
|
||||
});
|
||||
$ionicHistory.removeBackView();
|
||||
$scope.sendStatus = '';
|
||||
|
||||
$ionicHistory.nextViewOptions({
|
||||
disableAnimate: true,
|
||||
historyRoot: true
|
||||
});
|
||||
$ionicHistory.clearHistory();
|
||||
$state.go('tabs.send').then(function() {
|
||||
$ionicHistory.clearHistory();
|
||||
$state.transitionTo('tabs.home');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.chooseFeeLevel = function(tx, wallet) {
|
||||
|
||||
|
||||
var scope = $rootScope.$new(true);
|
||||
scope.network = tx.network;
|
||||
scope.feeLevel = tx.feeLevel;
|
||||
|
|
|
@ -12,7 +12,7 @@ angular.module('copayApp.directives')
|
|||
|
||||
elem.bind('click', function() {
|
||||
configService.whenAvailable(function(config) {
|
||||
if (config.wallet.settings.feeLevel.match(/conomy/)) {
|
||||
if (config.wallet.settings.feeLevel && config.wallet.settings.feeLevel.match(/conomy/)) {
|
||||
$log.debug('Economy Fee setting... disabling link:' + elem.text());
|
||||
popupService.showAlert('Low Fee Error', 'Please change your Bitcoin Network Fee Policy setting to Normal or higher to use this service', function() {
|
||||
$ionicHistory.goBack();
|
||||
|
|
|
@ -9,7 +9,7 @@ angular.module('copayApp.directives')
|
|||
scope: {
|
||||
sendStatus: '=slideSendStatus',
|
||||
onConfirm: '&slideOnConfirm',
|
||||
wallet: '=hasWalletChosen'
|
||||
isDisabled: '=isDisabled'
|
||||
},
|
||||
link: function(scope, element, attrs) {
|
||||
|
||||
|
|
|
@ -53,23 +53,17 @@
|
|||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
ng-disabled="!wallet"
|
||||
ng-click="buyConfirm()"
|
||||
ng-if="!isCordova"
|
||||
click-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="false">
|
||||
is-disabled="!wallet">
|
||||
Confirm purchase
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-disabled="!wallet"
|
||||
ng-if="isCordova"
|
||||
slide-on-confirm="buyConfirm()"
|
||||
slide-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="false">
|
||||
is-disabled="!wallet">
|
||||
Slide to buy
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
|
|
|
@ -74,23 +74,17 @@
|
|||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
ng-disabled="!selectedPaymentMethodId.value || !buyRequestInfo || !wallet"
|
||||
ng-click="buyConfirm()"
|
||||
ng-if="!isCordova && buyRequestInfo"
|
||||
click-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="!selectedPaymentMethodId.value"
|
||||
no-matching-wallet="!buyRequestInfo">
|
||||
is-disabled="!selectedPaymentMethodId.value || !buyRequestInfo || !wallet">
|
||||
Confirm purchase
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-disabled="!selectedPaymentMethodId.value || !buyRequestInfo || !wallet"
|
||||
ng-if="isCordova && buyRequestInfo"
|
||||
slide-on-confirm="buyConfirm()"
|
||||
slide-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="!selectedPaymentMethodId.value"
|
||||
no-matching-wallet="!buyRequestInfo">
|
||||
is-disabled="!selectedPaymentMethodId.value || !buyRequestInfo || !wallet">
|
||||
Slide to buy
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
|
|
|
@ -64,23 +64,17 @@
|
|||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
ng-disabled="!buyInfo || !wallet"
|
||||
ng-click="buyConfirm()"
|
||||
ng-if="!isCordova && buyInfo"
|
||||
click-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="!buyInfo">
|
||||
is-disabled="!buyInfo || !wallet">
|
||||
Confirm purchase
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-disabled="!buyInfo || !wallet"
|
||||
ng-if="isCordova && buyInfo"
|
||||
slide-on-confirm="buyConfirm()"
|
||||
slide-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="!buyInfo">
|
||||
is-disabled="!buyInfo || !wallet">
|
||||
Slide to buy
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
</ion-nav-back-button>
|
||||
</ion-nav-bar>
|
||||
|
||||
<ion-content ng-class="{'add-bottom-for-cta': !wallet}">
|
||||
<ion-content class="add-bottom-for-cta">
|
||||
<div class="list">
|
||||
<div class="item head">
|
||||
<div class="sending-label">
|
||||
|
|
|
@ -9,51 +9,51 @@
|
|||
<div class="list">
|
||||
<div class="item head">
|
||||
<div class="amount-label">
|
||||
<div class="amount">{{displayAmount || '...'}} <span class="unit">{{displayUnit}}</span></div>
|
||||
<div class="alternative">{{alternativeAmountStr || '...'}}</div>
|
||||
<div class="amount">{{tx.amountValueStr || '...'}} <span class="unit">{{tx.amountUnitStr}}</span></div>
|
||||
<div class="alternative">{{tx.alternativeAmountStr || '...'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="item single-line" ng-if="paypro.domain">
|
||||
<div class="item single-line" ng-if="tx.paypro.domain">
|
||||
<span class="label">{{'Pay To'|translate}}</span>
|
||||
<span class="item-note">
|
||||
{{paypro.domain}}
|
||||
{{tx.paypro.domain}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item single-line" ng-if="paypro.toAddress">
|
||||
<div class="item single-line" ng-if="tx.paypro.toAddress">
|
||||
<span class="label">{{'Address'|translate}}</span>
|
||||
<span class="item-note m10l ellipsis">
|
||||
{{paypro.toAddress}}
|
||||
{{tx.paypro.toAddress}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label">{{'Certified by'|translate}}</span>
|
||||
<span class="item-note w100p">
|
||||
<span ng-show="paypro.caTrusted">
|
||||
<span ng-show="tx.paypro.caTrusted">
|
||||
<i class="ion-locked" style="color:green"></i>
|
||||
{{paypro.caName}} {{'(Trusted)' | translate}}</span>
|
||||
{{tx.paypro.caName}} {{'(Trusted)' | translate}}</span>
|
||||
</span>
|
||||
<span ng-show="!paypro.caTrusted">
|
||||
<span ng-show="paypro.selfSigned">
|
||||
<span ng-show="!tx.paypro.caTrusted">
|
||||
<span ng-show="tx.paypro.selfSigned">
|
||||
<i class="ion-unlocked" style="color:red"></i> <span translate>Self-signed Certificate</span>
|
||||
</span>
|
||||
<span ng-show="!paypro.selfSigned">
|
||||
<i class="ion-locked" style="color:yellow"></i>{{paypro.caName}}<br>
|
||||
<span ng-show="!tx.paypro.selfSigned">
|
||||
<i class="ion-locked" style="color:yellow"></i>{{tx.paypro.caName}}<br>
|
||||
<span translate>WARNING: UNTRUSTED CERTIFICATE</span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="item" ng-if="paypro.memo">
|
||||
<div class="item" ng-if="tx.paypro.memo">
|
||||
<span class="label">{{'Memo'|translate}}</span>
|
||||
<span class="item-note w100p">
|
||||
{{paypro.memo}}
|
||||
{{tx.paypro.memo}}
|
||||
</span>
|
||||
</div>
|
||||
<div class="item single-line" ng-if="paypro.expires">
|
||||
<div class="item single-line" ng-if="tx.paypro.expires">
|
||||
<span class="label">{{'Expires'|translate}}</span>
|
||||
<span class="item-note">
|
||||
{{paypro.expires * 1000 | amTimeAgo }}
|
||||
{{tx.paypro.expires * 1000 | amTimeAgo }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -107,23 +107,17 @@
|
|||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
ng-disabled="!selectedPaymentMethodId.value || !sellRequestInfo || !wallet"
|
||||
ng-click="sellConfirm()"
|
||||
ng-if="!isCordova && sellRequestInfo"
|
||||
click-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="!selectedPaymentMethodId.value"
|
||||
no-matching-wallet="!sellRequestInfo">
|
||||
is-disabled="!selectedPaymentMethodId.value || !sellRequestInfo || !wallet">
|
||||
Confirm sale
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-disabled="!selectedPaymentMethodId.value || !sellRequestInfo || !wallet"
|
||||
ng-if="isCordova && sellRequestInfo"
|
||||
slide-on-confirm="sellConfirm()"
|
||||
slide-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="!selectedPaymentMethodId.value"
|
||||
no-matching-wallet="!sellRequestInfo">
|
||||
is-disabled="!selectedPaymentMethodId.value || !sellRequestInfo || !wallet">
|
||||
Slide to sell
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
|
|
|
@ -64,23 +64,17 @@
|
|||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
ng-disabled="!sellInfo || !wallet"
|
||||
ng-click="sellConfirm()"
|
||||
ng-if="!isCordova && sellInfo"
|
||||
click-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="!sellInfo">
|
||||
is-disabled="!sellInfo || !wallet">
|
||||
Confirm sale
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-disabled="!sellInfo || !wallet"
|
||||
ng-if="isCordova && sellInfo"
|
||||
slide-on-confirm="sellConfirm()"
|
||||
slide-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="false"
|
||||
no-matching-wallet="!sellInfo">
|
||||
is-disabled="!sellInfo || !wallet">
|
||||
Slide to sell
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
|
|
|
@ -60,23 +60,17 @@
|
|||
</ion-content>
|
||||
|
||||
<click-to-accept
|
||||
ng-disabled="!cardInfo || !wallet"
|
||||
ng-click="topUpConfirm()"
|
||||
ng-if="!isCordova && cardInfo"
|
||||
click-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="insufficientFunds"
|
||||
no-matching-wallet="!cardInfo">
|
||||
is-disabled="!cardInfo || !wallet">
|
||||
Add funds
|
||||
</click-to-accept>
|
||||
<slide-to-accept
|
||||
ng-disabled="!cardInfo || !wallet"
|
||||
ng-if="isCordova && cardInfo"
|
||||
slide-on-confirm="topUpConfirm()"
|
||||
slide-send-status="sendStatus"
|
||||
has-wallet-chosen="wallet"
|
||||
insufficient-funds="insufficientFunds"
|
||||
no-matching-wallet="!cardInfo">
|
||||
is-disabled="!cardInfo || !wallet">
|
||||
Slide to confirm
|
||||
</slide-to-accept>
|
||||
<slide-to-accept-success
|
||||
|
|
Loading…
Reference in New Issue