Ref amount-confirm sendMax

This commit is contained in:
Gustavo Maximiliano Cortez 2017-09-01 15:26:12 -03:00
commit 9f9bb1b728
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
2 changed files with 9 additions and 7 deletions

View file

@ -369,7 +369,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
id: _id, id: _id,
amount: $scope.useSendMax ? null : _amount, amount: $scope.useSendMax ? null : _amount,
currency: unit.id.toUpperCase(), currency: unit.id.toUpperCase(),
coin: coin, coin: $scope.useSendMax ? null : coin,
useSendMax: $scope.useSendMax useSendMax: $scope.useSendMax
}); });
} else { } else {
@ -388,7 +388,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
toName: $scope.toName, toName: $scope.toName,
toEmail: $scope.toEmail, toEmail: $scope.toEmail,
toColor: $scope.toColor, toColor: $scope.toColor,
coin: coin, coin: $scope.useSendMax ? null : coin,
useSendMax: $scope.useSendMax useSendMax: $scope.useSendMax
}); });
} }

View file

@ -69,7 +69,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
function setWalletSelector(coin, network, minAmount, sendMax, cb) { function setWalletSelector(coin, network, minAmount, cb) {
// no min amount? (sendMax) => look for no empty wallets // no min amount? (sendMax) => look for no empty wallets
minAmount = minAmount || 1; minAmount = minAmount || 1;
@ -77,7 +77,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$scope.wallets = profileService.getWallets({ $scope.wallets = profileService.getWallets({
onlyComplete: true, onlyComplete: true,
network: network, network: network,
coin: sendMax ? null : coin coin: coin
}); });
if (!$scope.wallets || !$scope.wallets.length) { if (!$scope.wallets || !$scope.wallets.length) {
@ -129,7 +129,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
description: data.stateParams.description, description: data.stateParams.description,
paypro: data.stateParams.paypro, paypro: data.stateParams.paypro,
feeLevel: data.stateParams.coin == 'bch' ? 'normal' : configFeeLevel, feeLevel: configFeeLevel,
spendUnconfirmed: walletConfig.spendUnconfirmed, spendUnconfirmed: walletConfig.spendUnconfirmed,
// Vanity tx info (not in the real tx) // Vanity tx info (not in the real tx)
@ -142,6 +142,8 @@ angular.module('copayApp.controllers').controller('confirmController', function(
txp: {}, txp: {},
}; };
if (tx.coin && tx.coin == 'bch') tx.feeLevel = 'normal';
// Other Scope vars // Other Scope vars
$scope.isCordova = isCordova; $scope.isCordova = isCordova;
$scope.isWindowsPhoneApp = isWindowsPhoneApp; $scope.isWindowsPhoneApp = isWindowsPhoneApp;
@ -149,7 +151,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
$scope.walletSelectorTitle = gettextCatalog.getString('Send from'); $scope.walletSelectorTitle = gettextCatalog.getString('Send from');
setWalletSelector(tx.coin, tx.network, tx.toAmount, tx.sendMax, function(err) { setWalletSelector(tx.coin, tx.network, tx.toAmount, function(err) {
if (err) { if (err) {
return exitWithError('Could not update wallets'); return exitWithError('Could not update wallets');
} }