diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index aad224372..cd9bf9429 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -22,7 +22,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.currency = data.stateParams.currency; $scope.forceCurrency = data.stateParams.forceCurrency; - $scope.showMenu = $ionicHistory.backView() && ($ionicHistory.backView().stateName == 'tabs.send' || + $scope.showMenu = $ionicHistory.backView() && ($ionicHistory.backView().stateName == 'tabs.send' || $ionicHistory.backView().stateName == 'tabs.bitpayCard'); $scope.recipientType = data.stateParams.recipientType || null; $scope.toAddress = data.stateParams.toAddress; @@ -30,6 +30,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.toEmail = data.stateParams.toEmail; $scope.showAlternativeAmount = !!$scope.nextStep; $scope.toColor = data.stateParams.toColor; + $scope.walletId = data.stateParams.walletId; $scope.showSendMax = false; $scope.customAmount = data.stateParams.customAmount; @@ -236,6 +237,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ var amount = $scope.showAlternativeAmount ? fromFiat(_amount) : _amount; if ($scope.customAmount) { $state.transitionTo('tabs.receive.customAmount', { + walletId: $scope.walletId, toAmount: (amount * unitToSatoshi).toFixed(0), toAddress: $scope.toAddress }); diff --git a/src/js/controllers/customAmount.js b/src/js/controllers/customAmount.js index 8aaa5b4dd..0f81cb1cb 100644 --- a/src/js/controllers/customAmount.js +++ b/src/js/controllers/customAmount.js @@ -1,6 +1,6 @@ 'use strict'; -angular.module('copayApp.controllers').controller('customAmountController', function($rootScope, $scope, $stateParams, $ionicHistory, txFormatService, platformInfo) { +angular.module('copayApp.controllers').controller('customAmountController', function($rootScope, $scope, $stateParams, $ionicHistory, txFormatService, platformInfo, profileService) { $scope.$on("$ionicView.beforeEnter", function(event, data) { var satToBtc = 1 / 100000000; @@ -10,6 +10,7 @@ angular.module('copayApp.controllers').controller('customAmountController', func $scope.amountBtc = ($scope.amount * satToBtc).toFixed(8); $scope.amountStr = txFormatService.formatAmountStr($scope.amount); $scope.altAmountStr = txFormatService.formatAlternativeStr($scope.amount); + $scope.wallet = profileService.getWallet($stateParams.walletId); }); $scope.finish = function() { diff --git a/src/js/controllers/tab-receive.js b/src/js/controllers/tab-receive.js index b32f2fbef..6953f7b1f 100644 --- a/src/js/controllers/tab-receive.js +++ b/src/js/controllers/tab-receive.js @@ -8,6 +8,7 @@ angular.module('copayApp.controllers').controller('tabReceiveController', functi $scope.requestSpecificAmount = function() { $state.go('tabs.receive.amount', { + walletId: $scope.wallet.credentials.walletId, customAmount: true, toAddress: $scope.addr }); diff --git a/src/js/routes.js b/src/js/routes.js index 1fa783a6c..ac5889e1f 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -681,7 +681,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr */ .state('tabs.receive.amount', { - url: '/amount/:customAmount/:toAddress', + url: '/amount/:walletId/:customAmount/:toAddress', views: { 'tab-receive@tabs': { controller: 'amountController', @@ -690,7 +690,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) .state('tabs.receive.customAmount', { - url: '/customAmount/:toAmount/:toAddress', + url: '/customAmount/:walletId/:toAmount/:toAddress', views: { 'tab-receive@tabs': { controller: 'customAmountController', diff --git a/www/views/addresses.html b/www/views/addresses.html index 5f2748221..6701b33b4 100644 --- a/www/views/addresses.html +++ b/www/views/addresses.html @@ -11,11 +11,7 @@ - +
diff --git a/www/views/customAmount.html b/www/views/customAmount.html index 07e6f2d91..f7a8c5379 100644 --- a/www/views/customAmount.html +++ b/www/views/customAmount.html @@ -12,6 +12,7 @@ +