Merge pull request #3569 from cmgustavo/ref/remove-adv-send
Ref/remove adv send
This commit is contained in:
commit
bf0c69c4ab
6 changed files with 105 additions and 177 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<div
|
<div
|
||||||
class="topbar-container"
|
class="topbar-container"
|
||||||
ng-include="'views/includes/topbar.html'"
|
ng-include="'views/includes/topbar.html'"
|
||||||
ng-init="titleSection='Buy'; goBackToState = 'glidera'">
|
ng-init="titleSection='Buy'; goBackToState = 'glidera'; noColor = true">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<div
|
<div
|
||||||
class="topbar-container"
|
class="topbar-container"
|
||||||
ng-include="'views/includes/topbar.html'"
|
ng-include="'views/includes/topbar.html'"
|
||||||
ng-init="titleSection='Preferences'; goBackToState = 'glidera'">
|
ng-init="titleSection='Preferences'; goBackToState = 'glidera'; noColor = true">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content preferences" ng-controller="preferencesGlideraController as glidera">
|
<div class="content preferences" ng-controller="preferencesGlideraController as glidera">
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<div
|
<div
|
||||||
class="topbar-container"
|
class="topbar-container"
|
||||||
ng-include="'views/includes/topbar.html'"
|
ng-include="'views/includes/topbar.html'"
|
||||||
ng-init="titleSection='Sell'; goBackToState = 'glidera'">
|
ng-init="titleSection='Sell'; goBackToState = 'glidera'; noColor = true">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -111,7 +111,7 @@
|
||||||
Please, enter the code below
|
Please, enter the code below
|
||||||
</p>
|
</p>
|
||||||
<form name="sellForm"
|
<form name="sellForm"
|
||||||
ng-submit="sell.createTx(index.glideraToken, index.glideraPermissions, twoFaCode)" novalidate>
|
ng-submit="sell.createTx(index.glideraToken, index.glideraPermissions, twoFaCode, index.feeRateToSendMax)" novalidate>
|
||||||
<input type="number" ng-model="twoFaCode" required>
|
<input type="number" ng-model="twoFaCode" required>
|
||||||
<input class="button black expand round"
|
<input class="button black expand round"
|
||||||
ng-style="{'background-color':index.backgroundColor}"
|
ng-style="{'background-color':index.backgroundColor}"
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,7 @@
|
||||||
<available-balance></available-balance>
|
<available-balance></available-balance>
|
||||||
<a class="db"
|
<a class="db"
|
||||||
ng-if="index.feeToSendMaxStr && index.availableBalanceSat > 0 && !home.blockUx && !home.lockAmount"
|
ng-if="index.feeToSendMaxStr && index.availableBalanceSat > 0 && !home.blockUx && !home.lockAmount"
|
||||||
ng-click="home.sendAll(index.availableMaxBalance, index.feeToSendMaxStr, index.feeRateToSendMax, index.currentFeeLevel)"
|
ng-click="home.sendAll(index.availableMaxBalance, index.feeToSendMaxStr)"
|
||||||
translate> Send All
|
translate> Send All
|
||||||
</a>
|
</a>
|
||||||
</h4>
|
</h4>
|
||||||
|
|
@ -280,7 +280,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row m20t">
|
<div class="row m20t">
|
||||||
<div class="large-12 large-centered columns m20t">
|
<div class="large-12 large-centered columns m20t">
|
||||||
<form name="sendForm" ng-submit="home.submitForm()" ng-disabled="home.blockUx || home.onGoingProcess" novalidate>
|
<form name="sendForm" ng-submit="home.submitForm(index.feeRateToSendMax)" ng-disabled="home.blockUx || home.onGoingProcess" novalidate>
|
||||||
<div class="box-notification" ng-show="home.error" ng-click="home.resetError()">
|
<div class="box-notification" ng-show="home.error" ng-click="home.resetError()">
|
||||||
<span class="text-warning">
|
<span class="text-warning">
|
||||||
{{home.error|translate}}
|
{{home.error|translate}}
|
||||||
|
|
@ -311,7 +311,7 @@
|
||||||
</div>
|
</div>
|
||||||
<a class="postfix button"
|
<a class="postfix button"
|
||||||
ng-style="{'background-color':index.backgroundColor}"
|
ng-style="{'background-color':index.backgroundColor}"
|
||||||
ng-click="openDestinationAddressModal(index.otherWallets, _address)">
|
ng-click="home.openDestinationAddressModal(index.otherWallets, _address)">
|
||||||
<i class="fi-plus size-14 lh"></i>
|
<i class="fi-plus size-14 lh"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -377,35 +377,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="m20b" ng-init="home.hideAdvSend=true" ng-show="!home.disableAdvSend">
|
|
||||||
<a class="button outline light-gray expand tiny m0" ng-click="home.hideAdvSend=!home.hideAdvSend">
|
|
||||||
<i class="fi-widget m3r"></i>
|
|
||||||
<span translate ng-hide="!home.hideAdvSend">Show advanced options</span>
|
|
||||||
<span translate ng-hide="home.hideAdvSend">Hide advanced options</span>
|
|
||||||
<i ng-if="home.hideAdvSend" class="icon-arrow-down4"></i>
|
|
||||||
<i ng-if="!home.hideAdvSend" class="icon-arrow-up4"></i>
|
|
||||||
</a>
|
|
||||||
<div class="m10t" ng-hide="home.hideAdvSend">
|
|
||||||
<div ng-show="(index.network == 'livenet' ? index.feeLevels.livenet : index.feeLevels.testnet)">
|
|
||||||
<h4 class="title m0" translate>Fee policy for this transaction</h4>
|
|
||||||
<ul class="no-bullet m0 size-14">
|
|
||||||
<li ng-repeat="fee in (index.network == 'livenet' ? index.feeLevels.livenet : index.feeLevels.testnet)"
|
|
||||||
ng-click="home.setFee(fee.level)" class="line-b p20">
|
|
||||||
{{index.feeOpts[fee.level]|translate}}
|
|
||||||
<i class="fi-check size-16 right"
|
|
||||||
ng-show="(home.currentSendFeeLevel || index.currentFeeLevel) == fee.level"></i>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<h4 class="title m0"> </h4>
|
|
||||||
<div class="p20 line-b">
|
|
||||||
<span class="size-14" translate>Use Unconfirmed Funds</span>
|
|
||||||
<switch id="spend-unconfirmed" name="currentSpendUnconfirmed" ng-model="currentSpendUnconfirmed" class="green right"></switch>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row" ng-show="!home.onGoingProcess">
|
<div class="row" ng-show="!home.onGoingProcess">
|
||||||
<div class="large-6 medium-6 small-6 columns" ng-show="!home.blockUx && (home._paypro || home.lockAddress || home.lockAmount)">
|
<div class="large-6 medium-6 small-6 columns" ng-show="!home.blockUx && (home._paypro || home.lockAddress || home.lockAmount)">
|
||||||
<a ng-click="home.resetForm(sendForm)" class="button expand outline dark-gray round" translate>Cancel</a>
|
<a ng-click="home.resetForm(sendForm)" class="button expand outline dark-gray round" translate>Cancel</a>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('sellGlideraController',
|
angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
function($scope, $timeout, $log, $modal, configService, profileService, addressService, feeService, glideraService, bwsError, lodash, isChromeApp, animationService) {
|
function($scope, $timeout, $log, $modal, configService, profileService, addressService, glideraService, bwsError, lodash, isChromeApp, animationService) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var config = configService.getSync();
|
var config = configService.getSync();
|
||||||
|
|
@ -11,7 +11,6 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
this.error = null;
|
this.error = null;
|
||||||
this.loading = null;
|
this.loading = null;
|
||||||
this.currentSpendUnconfirmed = config.wallet.spendUnconfirmed;
|
this.currentSpendUnconfirmed = config.wallet.spendUnconfirmed;
|
||||||
this.currentFeeLevel = config.wallet.settings.feeLevel || 'normal';
|
|
||||||
var fc;
|
var fc;
|
||||||
|
|
||||||
var otherWallets = function(testnet) {
|
var otherWallets = function(testnet) {
|
||||||
|
|
@ -123,7 +122,7 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.createTx = function(token, permissions, twoFaCode) {
|
this.createTx = function(token, permissions, twoFaCode, currentFeePerKb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.error = null;
|
self.error = null;
|
||||||
|
|
||||||
|
|
@ -143,65 +142,62 @@ angular.module('copayApp.controllers').controller('sellGlideraController',
|
||||||
}
|
}
|
||||||
var amount = parseInt((self.sellPrice.qty * 100000000).toFixed(0));
|
var amount = parseInt((self.sellPrice.qty * 100000000).toFixed(0));
|
||||||
|
|
||||||
feeService.getCurrentFeeValue(self.currentFeeLevel, function(err, feePerKb) {
|
fc.sendTxProposal({
|
||||||
if (err) $log.debug(err);
|
toAddress: sellAddress,
|
||||||
fc.sendTxProposal({
|
amount: amount,
|
||||||
toAddress: sellAddress,
|
message: 'Glidera transaction',
|
||||||
amount: amount,
|
customData: {'glideraToken': token},
|
||||||
message: 'Glidera transaction',
|
payProUrl: null,
|
||||||
customData: {'glideraToken': token},
|
feePerKb: currentFeePerKb,
|
||||||
payProUrl: null,
|
excludeUnconfirmedUtxos: self.currentSpendUnconfirmed ? false : true
|
||||||
feePerKb: feePerKb,
|
}, function(err, txp) {
|
||||||
excludeUnconfirmedUtxos: self.currentSpendUnconfirmed ? false : true
|
if (err) {
|
||||||
}, function(err, txp) {
|
profileService.lockFC();
|
||||||
if (err) {
|
$log.error(err);
|
||||||
profileService.lockFC();
|
$timeout(function() {
|
||||||
$log.error(err);
|
|
||||||
$timeout(function() {
|
|
||||||
self.loading = null;
|
|
||||||
self.error = bwsError.msg(err, 'Error');
|
|
||||||
}, 1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fc.canSign()) {
|
|
||||||
self.loading = null;
|
self.loading = null;
|
||||||
$log.info('No signing proposal: No private key');
|
self.error = bwsError.msg(err, 'Error');
|
||||||
return;
|
}, 1);
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_signTx(txp, function(err, txp, rawTx) {
|
if (!fc.canSign()) {
|
||||||
profileService.lockFC();
|
self.loading = null;
|
||||||
if (err) {
|
$log.info('No signing proposal: No private key');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_signTx(txp, function(err, txp, rawTx) {
|
||||||
|
profileService.lockFC();
|
||||||
|
if (err) {
|
||||||
|
self.loading = null;
|
||||||
|
self.error = err;
|
||||||
|
$scope.$apply();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var data = {
|
||||||
|
refundAddress: refundAddress,
|
||||||
|
signedTransaction: rawTx,
|
||||||
|
priceUuid: self.sellPrice.priceUuid,
|
||||||
|
useCurrentPrice: self.sellPrice.priceUuid ? false : true,
|
||||||
|
ip: null
|
||||||
|
};
|
||||||
|
glideraService.sell(token, twoFaCode, data, function(err, data) {
|
||||||
self.loading = null;
|
self.loading = null;
|
||||||
self.error = err;
|
if (err) {
|
||||||
$scope.$apply();
|
self.error = err;
|
||||||
}
|
fc.removeTxProposal(txp, function(err, txpb) {
|
||||||
else {
|
$timeout(function() {
|
||||||
var data = {
|
$scope.$emit('Local/GlideraError');
|
||||||
refundAddress: refundAddress,
|
}, 100);
|
||||||
signedTransaction: rawTx,
|
});
|
||||||
priceUuid: self.sellPrice.priceUuid,
|
}
|
||||||
useCurrentPrice: self.sellPrice.priceUuid ? false : true,
|
else {
|
||||||
ip: null
|
self.success = data;
|
||||||
};
|
$scope.$emit('Local/GlideraTx');
|
||||||
glideraService.sell(token, twoFaCode, data, function(err, data) {
|
}
|
||||||
self.loading = null;
|
});
|
||||||
if (err) {
|
}
|
||||||
self.error = err;
|
|
||||||
fc.removeTxProposal(txp, function(err, txpb) {
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$emit('Local/GlideraError');
|
|
||||||
}, 100);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
self.success = data;
|
|
||||||
$scope.$emit('Local/GlideraTx');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $timeout, $filter, $modal, $log, notification, txStatus, isCordova, profileService, lodash, configService, rateService, storageService, bitcore, isChromeApp, gettext, gettextCatalog, nodeWebkit, addressService, ledger, feeService, bwsError, confirmDialog, txFormatService, animationService, addressbookService, go) {
|
angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $timeout, $filter, $modal, $log, notification, txStatus, isCordova, profileService, lodash, configService, rateService, storageService, bitcore, isChromeApp, gettext, gettextCatalog, nodeWebkit, addressService, ledger, bwsError, confirmDialog, txFormatService, animationService, addressbookService, go) {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
$rootScope.hideMenuBar = false;
|
$rootScope.hideMenuBar = false;
|
||||||
$rootScope.wpInputFocused = false;
|
$rootScope.wpInputFocused = false;
|
||||||
var config = configService.getSync();
|
var config = configService.getSync();
|
||||||
var configWallet = config.wallet;
|
var configWallet = config.wallet;
|
||||||
$scope.currentSpendUnconfirmed = configWallet.spendUnconfirmed;
|
|
||||||
|
|
||||||
// INIT
|
// INIT
|
||||||
var walletSettings = configWallet.settings;
|
var walletSettings = configWallet.settings;
|
||||||
|
|
@ -23,7 +22,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
this.isMobile = isMobile.any();
|
this.isMobile = isMobile.any();
|
||||||
this.isWindowsPhoneApp = isMobile.Windows() && isCordova;
|
this.isWindowsPhoneApp = isMobile.Windows() && isCordova;
|
||||||
this.blockUx = false;
|
this.blockUx = false;
|
||||||
this.disableAdvSend = false;
|
|
||||||
this.isRateAvailable = false;
|
this.isRateAvailable = false;
|
||||||
this.showScanner = false;
|
this.showScanner = false;
|
||||||
this.isMobile = isMobile.any();
|
this.isMobile = isMobile.any();
|
||||||
|
|
@ -115,10 +113,11 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
var cancel_msg = gettextCatalog.getString('Cancel');
|
var cancel_msg = gettextCatalog.getString('Cancel');
|
||||||
var confirm_msg = gettextCatalog.getString('Confirm');
|
var confirm_msg = gettextCatalog.getString('Confirm');
|
||||||
|
|
||||||
$scope.openDestinationAddressModal = function(wallets, address) {
|
this.openDestinationAddressModal = function(wallets, address) {
|
||||||
$rootScope.modalOpened = true;
|
$rootScope.modalOpened = true;
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
self.resetForm();
|
self.lockAddress = false;
|
||||||
|
self._address = null;
|
||||||
|
|
||||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||||
$scope.wallets = wallets;
|
$scope.wallets = wallets;
|
||||||
|
|
@ -272,7 +271,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
$rootScope.modalOpened = true;
|
$rootScope.modalOpened = true;
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
var refreshUntilItChanges = false;
|
var refreshUntilItChanges = false;
|
||||||
var currentSpendUnconfirmed = $scope.currentSpendUnconfirmed;
|
var currentSpendUnconfirmed = configWallet.spendUnconfirmed;
|
||||||
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
var ModalInstanceCtrl = function($scope, $modalInstance) {
|
||||||
$scope.error = null;
|
$scope.error = null;
|
||||||
$scope.copayers = copayers
|
$scope.copayers = copayers
|
||||||
|
|
@ -662,15 +661,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
|
|
||||||
// Send
|
// Send
|
||||||
|
|
||||||
var unwatchSpendUnconfirmed = $scope.$watch('currentSpendUnconfirmed', function(newVal, oldVal) {
|
|
||||||
if (newVal == oldVal) return;
|
|
||||||
$scope.currentSpendUnconfirmed = newVal;
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.$on('$destroy', function() {
|
|
||||||
unwatchSpendUnconfirmed();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.canShowAlternative = function() {
|
this.canShowAlternative = function() {
|
||||||
return $scope.showAlternative;
|
return $scope.showAlternative;
|
||||||
};
|
};
|
||||||
|
|
@ -838,13 +828,10 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setFee = function(level) {
|
this.submitForm = function(currentFeePerKb) {
|
||||||
this.currentSendFeeLevel = level;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.submitForm = function() {
|
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
var unitToSat = this.unitToSatoshi;
|
var unitToSat = this.unitToSatoshi;
|
||||||
|
var currentSpendUnconfirmed = configWallet.spendUnconfirmed;
|
||||||
|
|
||||||
if (isCordova && this.isWindowsPhoneApp) {
|
if (isCordova && this.isWindowsPhoneApp) {
|
||||||
this.hideAddress = false;
|
this.hideAddress = false;
|
||||||
|
|
@ -882,14 +869,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
address = form.address.$modelValue;
|
address = form.address.$modelValue;
|
||||||
amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0));
|
amount = parseInt((form.amount.$modelValue * unitToSat).toFixed(0));
|
||||||
|
|
||||||
var getFee = function(cb) {
|
|
||||||
if (form.feePerKb) {
|
|
||||||
cb(null, form.feePerKb);
|
|
||||||
} else {
|
|
||||||
feeService.getCurrentFeeValue(self.currentSendFeeLevel, cb);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
requestTouchid(function(err) {
|
requestTouchid(function(err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
profileService.lockFC();
|
profileService.lockFC();
|
||||||
|
|
@ -901,43 +880,40 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFee(function(err, feePerKb) {
|
fc.sendTxProposal({
|
||||||
if (err) $log.debug(err);
|
toAddress: address,
|
||||||
fc.sendTxProposal({
|
amount: amount,
|
||||||
toAddress: address,
|
message: comment,
|
||||||
amount: amount,
|
payProUrl: paypro ? paypro.url : null,
|
||||||
message: comment,
|
feePerKb: currentFeePerKb,
|
||||||
payProUrl: paypro ? paypro.url : null,
|
excludeUnconfirmedUtxos: currentSpendUnconfirmed ? false : true
|
||||||
feePerKb: feePerKb,
|
}, function(err, txp) {
|
||||||
excludeUnconfirmedUtxos: $scope.currentSpendUnconfirmed ? false : true
|
if (err) {
|
||||||
}, function(err, txp) {
|
self.setOngoingProcess();
|
||||||
if (err) {
|
profileService.lockFC();
|
||||||
self.setOngoingProcess();
|
return self.setSendError(err);
|
||||||
profileService.lockFC();
|
}
|
||||||
return self.setSendError(err);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fc.canSign() && !fc.isPrivKeyExternal()) {
|
if (!fc.canSign() && !fc.isPrivKeyExternal()) {
|
||||||
$log.info('No signing proposal: No private key')
|
$log.info('No signing proposal: No private key')
|
||||||
self.setOngoingProcess();
|
self.setOngoingProcess();
|
||||||
self.resetForm();
|
self.resetForm();
|
||||||
txStatus.notify(txp, function() {
|
txStatus.notify(txp, function() {
|
||||||
return $scope.$emit('Local/TxProposalAction');
|
return $scope.$emit('Local/TxProposalAction');
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.signAndBroadcast(txp, function(err) {
|
|
||||||
self.setOngoingProcess();
|
|
||||||
self.resetForm();
|
|
||||||
if (err) {
|
|
||||||
self.error = err.message ? err.message : gettext('The payment was created but could not be completed. Please try again from home screen');
|
|
||||||
$scope.$emit('Local/TxProposalAction');
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$digest();
|
|
||||||
}, 1);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.signAndBroadcast(txp, function(err) {
|
||||||
|
self.setOngoingProcess();
|
||||||
|
self.resetForm();
|
||||||
|
if (err) {
|
||||||
|
self.error = err.message ? err.message : gettext('The payment was created but could not be completed. Please try again from home screen');
|
||||||
|
$scope.$emit('Local/TxProposalAction');
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.$digest();
|
||||||
|
}, 1);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -994,7 +970,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setForm = function(to, amount, comment, feeRate) {
|
this.setForm = function(to, amount, comment) {
|
||||||
var form = $scope.sendForm;
|
var form = $scope.sendForm;
|
||||||
if (to) {
|
if (to) {
|
||||||
form.address.$setViewValue(to);
|
form.address.$setViewValue(to);
|
||||||
|
|
@ -1015,10 +991,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
form.comment.$isValid = true;
|
form.comment.$isValid = true;
|
||||||
form.comment.$render();
|
form.comment.$render();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (feeRate) {
|
|
||||||
form.feeRate = feeRate;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1029,19 +1001,11 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
|
|
||||||
this.lockAddress = false;
|
this.lockAddress = false;
|
||||||
this.lockAmount = false;
|
this.lockAmount = false;
|
||||||
this.currentSendFeeLevel = null;
|
|
||||||
this.hideAdvSend = true;
|
|
||||||
this.disableAdvSend = false;
|
|
||||||
$scope.currentSpendUnconfirmed = configService.getSync().wallet.spendUnconfirmed;
|
|
||||||
|
|
||||||
this._amount = this._address = null;
|
this._amount = this._address = null;
|
||||||
|
|
||||||
var form = $scope.sendForm;
|
var form = $scope.sendForm;
|
||||||
|
|
||||||
if (form && form.feeRate) {
|
|
||||||
form.feeRate = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (form && form.amount) {
|
if (form && form.amount) {
|
||||||
form.amount.$pristine = true;
|
form.amount.$pristine = true;
|
||||||
form.amount.$setViewValue('');
|
form.amount.$setViewValue('');
|
||||||
|
|
@ -1291,11 +1255,11 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
return actions.hasOwnProperty('create');
|
return actions.hasOwnProperty('create');
|
||||||
};
|
};
|
||||||
|
|
||||||
this._doSendAll = function(amount, feeRate) {
|
this._doSendAll = function(amount) {
|
||||||
this.setForm(null, amount, null, feeRate);
|
this.setForm(null, amount, null);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.sendAll = function(amount, feeStr, feeRate, currentFeeLevel) {
|
this.sendAll = function(amount, feeStr) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var msg = gettextCatalog.getString("{{fee}} will be deducted for bitcoin networking fees", {
|
var msg = gettextCatalog.getString("{{fee}} will be deducted for bitcoin networking fees", {
|
||||||
fee: feeStr
|
fee: feeStr
|
||||||
|
|
@ -1303,10 +1267,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
|
|
||||||
confirmDialog.show(msg, function(confirmed) {
|
confirmDialog.show(msg, function(confirmed) {
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
self._doSendAll(amount, feeRate);
|
self._doSendAll(amount);
|
||||||
self.disableAdvSend = true;
|
|
||||||
self.currentSendFeeLevel = currentFeeLevel;
|
|
||||||
$scope.currentSpendUnconfirmed = configService.getSync().wallet.spendUnconfirmed;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue