reuse changeWallet on walletbar

This commit is contained in:
Matias Alejo Garcia 2014-12-07 20:41:17 -03:00
commit b370e710fe
3 changed files with 5 additions and 11 deletions

View file

@ -4,12 +4,6 @@ angular.module('copayApp.controllers').controller('HomeWalletController', functi
$scope.init = function() {
$rootScope.title = 'Home';
// fix for Safari and mobile devices
var walletId = $location.hash();
if (walletId) {
$location.hash('');
identityService.setFocusedWallet(walletId);
}
$scope.rateService = rateService;
$scope.isRateAvailable = false;

View file

@ -27,18 +27,18 @@ angular.module('copayApp.services')
});
};
// TODO should be on 'walletService'
// TODO should be on 'walletService' or 'go'
root.goWalletHome = function() {
var w = $rootScope.wallet;
if (w) {
$rootScope.starting = false;
if (!w.isComplete()) {
$location.path('/copayers');
go.go('copayers');
} else {
if ($rootScope.pendingPayment) {
$location.path('paymentIntent');
go.go('paymentIntent');
} else {
$location.path('homeWallet');
go.go('homeWallet');
}
}
}

View file

@ -11,7 +11,7 @@
<div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div>
</div>
<div class="col2">
<a ng-click="$root.go('/homeWallet#{{item.id}}')" class="size-12 wallet-item">
<a ng-click="switchWallet(item.id)" class="size-12 wallet-item">
<div class="oh">
<div class="right size-10 type-wallet">
[ {{item.requiredCopayers}} of {{item.totalCopayers}} ]</div>