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');
}
}
}