Merge pull request #310 from JDonadio/bug/multiple-enter-amount

Amount view - Prevent to tap multiple times and open multimple views
This commit is contained in:
Matias Alejo Garcia 2016-10-07 14:58:44 -03:00 committed by GitHub
commit b53f5cedf4
1 changed files with 16 additions and 14 deletions

View File

@ -54,7 +54,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
$timeout(function() { $timeout(function() {
$ionicScrollDelegate.resize(); $ionicScrollDelegate.resize();
$scope.$apply(); $scope.$apply();
}, 100); });
}); });
}; };
@ -73,7 +73,7 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
$scope.list = originalList; $scope.list = originalList;
$timeout(function() { $timeout(function() {
$scope.$apply(); $scope.$apply();
}, 10); });
return; return;
} }
@ -86,18 +86,20 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
}; };
$scope.goToAmount = function(item) { $scope.goToAmount = function(item) {
item.getAddress(function(err, addr) { $timeout(function() {
if (err || !addr) { item.getAddress(function(err, addr) {
$log.error(err); if (err || !addr) {
return; $log.error(err);
} return;
$log.debug('Got toAddress:' + addr + ' | ' + item.name); }
return $state.transitionTo('tabs.send.amount', { $log.debug('Got toAddress:' + addr + ' | ' + item.name);
isWallet: item.isWallet, return $state.transitionTo('tabs.send.amount', {
toAddress: addr, isWallet: item.isWallet,
toName: item.name, toAddress: addr,
toEmail: item.email toName: item.name,
}) toEmail: item.email
})
});
}); });
}; };