Fix flow for bitpay card

This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-28 11:08:08 -03:00
commit 11a7e96c08
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
6 changed files with 42 additions and 48 deletions

View file

@ -98,23 +98,6 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
});
};
this.init = function() {
$scope.dateRange = 'last30Days';
$scope.network = bitpayCardService.getEnvironment();
$scope.wallets = profileService.getWallets({
network: $scope.network,
onlyComplete: true
});
self.update();
wallet = $scope.wallets[0];
if (wallet && wallet.credentials.n > 1)
self.isMultisigWallet = true;
};
this.sendFunds = function() {
if (lodash.isEmpty(wallet)) return;
@ -258,5 +241,22 @@ angular.module('copayApp.controllers').controller('bitpayCardController', functi
return tx.description;
};
$scope.$on("$ionicView.beforeEnter", function(event, data){
$scope.dateRange = 'last30Days';
$scope.network = bitpayCardService.getEnvironment();
$scope.wallets = profileService.getWallets({
network: $scope.network,
onlyComplete: true
});
self.update();
wallet = $scope.wallets[0];
if (wallet && wallet.credentials.n > 1)
self.isMultisigWallet = true;
});
});

View file

@ -76,7 +76,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
});
}
$state.go('tabs.details', {
$state.go('tabs.wallet', {
walletId: wallet.credentials.walletId
});
};