diff --git a/src/js/controllers/amount.controller.js b/src/js/controllers/amount.controller.js index 07f31bb3e..f837ff2f3 100644 --- a/src/js/controllers/amount.controller.js +++ b/src/js/controllers/amount.controller.js @@ -30,7 +30,7 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory, vm.sendableFunds = ''; vm.showSendMaxButton = false; vm.showSendLimitMaxButton = false; - vm.thirdParty = false; + vm.thirdParty = null; vm.unit = ''; // Functions @@ -88,11 +88,16 @@ function amountController(configService, $filter, gettextCatalog, $ionicHistory, sendFlowService.state.pop(); } + + initCurrencies(); passthroughParams = sendFlowService.state.getClone(); 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.toWalletId = passthroughParams.toWalletId; vm.minAmount = parseFloat(passthroughParams.minAmount); diff --git a/src/js/controllers/review.controller.js b/src/js/controllers/review.controller.js index 66a9da040..67a4164c8 100644 --- a/src/js/controllers/review.controller.js +++ b/src/js/controllers/review.controller.js @@ -79,9 +79,12 @@ angular $scope.$on("$ionicView.beforeEnter", onBeforeEnter); - function onBeforeEnter(event, data) { $log.debug('reviewController onBeforeEnter sendflow ', sendFlowService.state); + + // Reset from last time + vm.thirdParty = null; + defaults = configService.getDefaults(); sendFlowData = sendFlowService.state.getClone(); originWalletId = sendFlowData.fromWalletId; diff --git a/src/js/controllers/wallet-selector.controller.js b/src/js/controllers/wallet-selector.controller.js index 036727333..0ccb3bd1f 100644 --- a/src/js/controllers/wallet-selector.controller.js +++ b/src/js/controllers/wallet-selector.controller.js @@ -52,9 +52,6 @@ angular $scope.specificAmount = $scope.specificAlternativeAmount = ''; $scope.isPaymentRequest = true; } - if ($scope.params.thirdParty) { - $scope.thirdParty = $scope.params.thirdParty; - } }; function onEnter (event, data) { @@ -62,7 +59,7 @@ angular $scope.selectedPriceDisplay = config.wallet.settings.priceDisplay; }); - if ($scope.thirdParty) { + if ($scope.params.thirdParty) { // Third party services specific logic handleThirdPartyIfShapeshift(); } @@ -102,8 +99,8 @@ angular } function handleThirdPartyIfShapeshift() { - console.log($scope.thirdParty, $scope.coin); - if ($scope.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the + console.log($scope.params.thirdParty, $scope.coin); + if ($scope.params.thirdParty.id === 'shapeshift' && $scope.type === 'destination') { // Shapeshift wants to know the $scope.coin = profileService.getWallet(fromWalletId).coin; if ($scope.coin === 'bch') { $scope.coin = 'btc'; @@ -117,6 +114,8 @@ angular var walletsAll = []; var walletsSufficientFunds = []; $scope.walletsInsufficientFunds = []; // For origin screen + $scope.walletsBtc = []; + $scope.walletsBch = []; if ($scope.type === 'origin') { $scope.headerTitle = gettextCatalog.getString('Choose a wallet to send from');