Merge pull request #183 from cmgustavo/ref/design-50
Bug fixes. Split contacts and wallets from send
This commit is contained in:
commit
1b2b49ce2b
8 changed files with 36 additions and 16 deletions
|
|
@ -31,7 +31,7 @@ angular.module('copayApp.controllers').controller('addressbookAddController', fu
|
|||
return;
|
||||
}
|
||||
if ($scope.fromSendTab) $scope.goHome();
|
||||
else $state.go('tabs.addressbook');
|
||||
else $ionicHistory.goBack();
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,10 +10,15 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
var SMALL_FONT_SIZE_LIMIT = 13;
|
||||
var LENGTH_EXPRESSION_LIMIT = 19;
|
||||
|
||||
$scope.isWallet = $stateParams.isWallet;
|
||||
$scope.toAddress = $stateParams.toAddress;
|
||||
$scope.toName = $stateParams.toName;
|
||||
$scope.toEmail = $stateParams.toEmail;
|
||||
|
||||
$scope.$on('$ionicView.beforeLeave', function() {
|
||||
angular.element($window).off('keydown');
|
||||
});
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
|
||||
if (!$stateParams.toAddress) {
|
||||
|
|
@ -24,7 +29,6 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
var reNr = /^[1234567890\.]$/;
|
||||
var reOp = /^[\*\+\-\/]$/;
|
||||
|
||||
|
||||
var disableKeys = angular.element($window).on('keydown', function(e) {
|
||||
if (e.which === 8) { // you can add others here inside brackets.
|
||||
e.preventDefault();
|
||||
|
|
@ -46,10 +50,6 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
|
||||
});
|
||||
|
||||
$scope.$on('$destroy', function() {
|
||||
angular.element($window).off('keydown');
|
||||
});
|
||||
|
||||
var config = configService.getSync().wallet.settings;
|
||||
$scope.unitName = config.unitName;
|
||||
$scope.alternativeIsoCode = config.alternativeIsoCode;
|
||||
|
|
@ -65,7 +65,6 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
$scope.amount = (($stateParams.toAmount) * satToUnit).toFixed(unitDecimals);
|
||||
}
|
||||
|
||||
|
||||
processAmount($scope.amount);
|
||||
|
||||
$timeout(function() {
|
||||
|
|
@ -187,6 +186,7 @@ angular.module('copayApp.controllers').controller('amountController', function($
|
|||
var amount = $scope.showAlternativeAmount ? fromFiat(_amount).toFixed(unitDecimals) : _amount.toFixed(unitDecimals);
|
||||
|
||||
$state.transitionTo('tabs.send.confirm', {
|
||||
isWallet: $scope.isWallet,
|
||||
toAmount: amount * unitToSatoshi,
|
||||
toAddress: $scope.toAddress,
|
||||
toName: $scope.toName,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
|||
var cachedTxp = {};
|
||||
var isChromeApp = platformInfo.isChromeApp;
|
||||
|
||||
$scope.isWallet = $stateParams.isWallet;
|
||||
$scope.toAddress = $stateParams.toAddress;
|
||||
$scope.toName = $stateParams.toName;
|
||||
$scope.toEmail = $stateParams.toEmail;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
var wallets = profileService.getWallets({
|
||||
onlyComplete: true
|
||||
});
|
||||
$scope.hasWallets = lodash.isEmpty(wallets) ? false : true;
|
||||
|
||||
lodash.each(wallets, function(v) {
|
||||
originalList.push({
|
||||
|
|
@ -25,6 +26,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
addressbookService.list(function(err, ab) {
|
||||
if (err) $log.error(err);
|
||||
|
||||
$scope.hasContacts = lodash.isEmpty(ab) ? false : true;
|
||||
var contacts = [];
|
||||
lodash.each(ab, function(v, k) {
|
||||
contacts.push({
|
||||
|
|
@ -76,6 +78,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
|
|||
}
|
||||
$log.debug('Got toAddress:' + addr + ' | ' + item.name);
|
||||
return $state.transitionTo('tabs.send.amount', {
|
||||
isWallet: item.isWallet,
|
||||
toAddress: addr,
|
||||
toName: item.name,
|
||||
toEmail: item.email
|
||||
|
|
|
|||
|
|
@ -236,8 +236,8 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
*
|
||||
*/
|
||||
|
||||
.state('tabs.send.amount', {
|
||||
url: '/amount/:toAddress/:toName/:toEmail',
|
||||
.state('tabs.send.amount', {
|
||||
url: '/amount/:isWallet/:toAddress/:toName/:toEmail',
|
||||
views: {
|
||||
'tab-send@tabs': {
|
||||
controller: 'amountController',
|
||||
|
|
@ -246,7 +246,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
}
|
||||
})
|
||||
.state('tabs.send.confirm', {
|
||||
url: '/confirm/:toAddress/:toName/:toAmount/:toEmail/:description/:paypro',
|
||||
url: '/confirm/:isWallet/:toAddress/:toName/:toAmount/:toEmail/:description/:paypro',
|
||||
views: {
|
||||
'tab-send@tabs': {
|
||||
controller: 'confirmController',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue