diff --git a/src/js/controllers/amount.js b/src/js/controllers/amount.js index 9701a951e..30af2a7bb 100644 --- a/src/js/controllers/amount.js +++ b/src/js/controllers/amount.js @@ -23,8 +23,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.forceCurrency = data.stateParams.forceCurrency; $scope.showMenu = $ionicHistory.backView() && $ionicHistory.backView().stateName == 'tabs.send'; - var isWallet = data.stateParams.isWallet || 'false'; - $scope.isWallet = (isWallet.toString().trim().toLowerCase() == 'true' ? true : false); + $scope.recipientType = data.stateParams.recipientType || null; $scope.toAddress = data.stateParams.toAddress; $scope.toName = data.stateParams.toName; $scope.toEmail = data.stateParams.toEmail; @@ -95,7 +94,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ $scope.sendMax = function() { $scope.showSendMax = false; $state.transitionTo('tabs.send.confirm', { - isWallet: $scope.isWallet, + recipientType: $scope.recipientType, toAmount: null, toAddress: $scope.toAddress, toName: $scope.toName, @@ -234,7 +233,7 @@ angular.module('copayApp.controllers').controller('amountController', function($ }); } else { $state.transitionTo('tabs.send.confirm', { - isWallet: $scope.isWallet, + recipientType: $scope.recipientType, toAmount: (amount * unitToSatoshi).toFixed(0), toAddress: $scope.toAddress, toName: $scope.toName, diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js index e2cadede5..759ce6cf6 100644 --- a/src/js/controllers/confirm.js +++ b/src/js/controllers/confirm.js @@ -14,7 +14,7 @@ angular.module('copayApp.controllers').controller('confirmController', function( toAmount = data.stateParams.toAmount; cachedSendMax = {}; $scope.useSendMax = data.stateParams.useSendMax == 'true' ? true : false; - $scope.isWallet = data.stateParams.isWallet == 'true' ? true : false; + $scope.recipientType = data.stateParams.recipientType || null; $scope.toAddress = data.stateParams.toAddress; $scope.toName = data.stateParams.toName; $scope.toEmail = data.stateParams.toEmail; diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js index dff61c55d..b795853e0 100644 --- a/src/js/controllers/tab-send.js +++ b/src/js/controllers/tab-send.js @@ -23,7 +23,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( originalList.push({ color: v.color, name: v.name, - isWallet: true, + recipientType: 'wallet', getAddress: function(cb) { walletService.getAddress(v, false, cb); }, @@ -41,6 +41,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( name: lodash.isObject(v) ? v.name : v, address: k, email: lodash.isObject(v) ? v.email : null, + recipientType: 'contact', getAddress: function(cb) { return cb(null, k); }, @@ -99,7 +100,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( } $log.debug('Got toAddress:' + addr + ' | ' + item.name); return $state.transitionTo('tabs.send.amount', { - isWallet: item.isWallet, + recipientType: item.recipientType, toAddress: addr, toName: item.name, toEmail: item.email, @@ -142,7 +143,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function( $log.error(err); // error updating the wallet. Probably a network error, do not show // the 'buy bitcoins' message. - + $scope.hasFunds = true; } else if (status.availableBalanceSat > 0) { $scope.hasFunds = true; diff --git a/src/js/directives/gravatar.js b/src/js/directives/gravatar.js index 2f85fe0eb..5f7931798 100644 --- a/src/js/directives/gravatar.js +++ b/src/js/directives/gravatar.js @@ -12,10 +12,10 @@ angular.module('copayApp.directives') email: '@' }, link: function(scope, el, attr) { - if(typeof scope.email === "string"){ + if (typeof scope.email === "string") { scope.emailHash = md5.createHash(scope.email.toLowerCase() || ''); } }, - template: '{{ name }}' + template: '{{ name }}' }; }); diff --git a/src/js/routes.js b/src/js/routes.js index bbe78a4cd..19b3b2477 100644 --- a/src/js/routes.js +++ b/src/js/routes.js @@ -274,7 +274,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr */ .state('tabs.send.amount', { - url: '/amount/:isWallet/:toAddress/:toName/:toEmail/:toColor', + url: '/amount/:recipientType/:toAddress/:toName/:toEmail/:toColor', views: { 'tab-send@tabs': { controller: 'amountController', @@ -283,7 +283,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr } }) .state('tabs.send.confirm', { - url: '/confirm/:isWallet/:toAddress/:toName/:toAmount/:toEmail/:toColor/:description/:useSendMax', + url: '/confirm/:recipientType/:toAddress/:toName/:toAmount/:toEmail/:toColor/:description/:useSendMax', views: { 'tab-send@tabs': { controller: 'confirmController', diff --git a/src/sass/views/confirm.scss b/src/sass/views/confirm.scss index 0b542c8f2..f55fb4d14 100644 --- a/src/sass/views/confirm.scss +++ b/src/sass/views/confirm.scss @@ -14,4 +14,7 @@ margin: 5px 0 0 8px; } } + .wallet-name { + margin-top: -3px; + } } diff --git a/www/views/amount.html b/www/views/amount.html index cd234b3a0..a8633099e 100644 --- a/www/views/amount.html +++ b/www/views/amount.html @@ -18,15 +18,20 @@
Recipient
- + - + + + + + + {{toName || toAddress}}
diff --git a/www/views/confirm.html b/www/views/confirm.html index 84230542e..5174b02b6 100644 --- a/www/views/confirm.html +++ b/www/views/confirm.html @@ -29,12 +29,8 @@
To - - - -
-
- + +