Merge pull request #363 from Bitcoin-com/wallet/task/546
546 - Fixes lost after the merge + fix send flow
This commit is contained in:
commit
b0283cee18
3 changed files with 15 additions and 8 deletions
|
|
@ -30,7 +30,7 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
|
||||||
vm.sendableFunds = '';
|
vm.sendableFunds = '';
|
||||||
vm.showSendMaxButton = false;
|
vm.showSendMaxButton = false;
|
||||||
vm.showSendLimitMaxButton = false;
|
vm.showSendLimitMaxButton = false;
|
||||||
vm.thirdParty = false;
|
vm.thirdParty = null;
|
||||||
vm.unit = '';
|
vm.unit = '';
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
|
|
@ -88,11 +88,16 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory,
|
||||||
sendFlowService.state.pop();
|
sendFlowService.state.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
initCurrencies();
|
initCurrencies();
|
||||||
|
|
||||||
passthroughParams = sendFlowService.state.getClone();
|
passthroughParams = sendFlowService.state.getClone();
|
||||||
console.log('amount onBeforeEnter after back sendflow ', passthroughParams);
|
console.log('amount onBeforeEnter after back sendflow ', passthroughParams);
|
||||||
|
|
||||||
|
// Init thirdParty, should be done for all the variable
|
||||||
|
vm.thirdParty = null;
|
||||||
|
|
||||||
vm.fromWalletId = passthroughParams.fromWalletId;
|
vm.fromWalletId = passthroughParams.fromWalletId;
|
||||||
vm.toWalletId = passthroughParams.toWalletId;
|
vm.toWalletId = passthroughParams.toWalletId;
|
||||||
vm.minAmount = parseFloat(passthroughParams.minAmount);
|
vm.minAmount = parseFloat(passthroughParams.minAmount);
|
||||||
|
|
|
||||||
|
|
@ -79,9 +79,12 @@ angular
|
||||||
|
|
||||||
$scope.$on("$ionicView.beforeEnter", onBeforeEnter);
|
$scope.$on("$ionicView.beforeEnter", onBeforeEnter);
|
||||||
|
|
||||||
|
|
||||||
function onBeforeEnter(event, data) {
|
function onBeforeEnter(event, data) {
|
||||||
$log.debug('reviewController onBeforeEnter sendflow ', sendFlowService.state);
|
$log.debug('reviewController onBeforeEnter sendflow ', sendFlowService.state);
|
||||||
|
|
||||||
|
// Reset from last time
|
||||||
|
vm.thirdParty = null;
|
||||||
|
|
||||||
defaults = configService.getDefaults();
|
defaults = configService.getDefaults();
|
||||||
sendFlowData = sendFlowService.state.getClone();
|
sendFlowData = sendFlowService.state.getClone();
|
||||||
originWalletId = sendFlowData.fromWalletId;
|
originWalletId = sendFlowData.fromWalletId;
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,6 @@ angular
|
||||||
$scope.specificAmount = $scope.specificAlternativeAmount = '';
|
$scope.specificAmount = $scope.specificAlternativeAmount = '';
|
||||||
$scope.isPaymentRequest = true;
|
$scope.isPaymentRequest = true;
|
||||||
}
|
}
|
||||||
if ($scope.params.thirdParty) {
|
|
||||||
$scope.thirdParty = $scope.params.thirdParty;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function onEnter (event, data) {
|
function onEnter (event, data) {
|
||||||
|
|
@ -62,7 +59,7 @@ angular
|
||||||
$scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;
|
$scope.selectedPriceDisplay = config.wallet.settings.priceDisplay;
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($scope.thirdParty) {
|
if ($scope.params.thirdParty) {
|
||||||
// Third party services specific logic
|
// Third party services specific logic
|
||||||
handleThirdPartyIfShapeshift();
|
handleThirdPartyIfShapeshift();
|
||||||
}
|
}
|
||||||
|
|
@ -102,8 +99,8 @@ angular
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleThirdPartyIfShapeshift() {
|
function handleThirdPartyIfShapeshift() {
|
||||||
console.log($scope.thirdParty, $scope.coin);
|
console.log($scope.params.thirdParty, $scope.coin);
|
||||||
if ($scope.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the
|
if ($scope.params.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the
|
||||||
$scope.coin = profileService.getWallet(fromWalletId).coin;
|
$scope.coin = profileService.getWallet(fromWalletId).coin;
|
||||||
if ($scope.coin === 'bch') {
|
if ($scope.coin === 'bch') {
|
||||||
$scope.coin = 'btc';
|
$scope.coin = 'btc';
|
||||||
|
|
@ -117,6 +114,8 @@ angular
|
||||||
var walletsAll = [];
|
var walletsAll = [];
|
||||||
var walletsSufficientFunds = [];
|
var walletsSufficientFunds = [];
|
||||||
$scope.walletsInsufficientFunds = []; // For origin screen
|
$scope.walletsInsufficientFunds = []; // For origin screen
|
||||||
|
$scope.walletsBtc = [];
|
||||||
|
$scope.walletsBch = [];
|
||||||
|
|
||||||
if ($scope.type === 'origin') {
|
if ($scope.type === 'origin') {
|
||||||
$scope.headerTitle = gettextCatalog.getString('Choose a wallet to send from');
|
$scope.headerTitle = gettextCatalog.getString('Choose a wallet to send from');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue