Fix flow for bitpay card

This commit is contained in:
Gustavo Maximiliano Cortez 2016-09-28 11:08:08 -03:00
parent 046fd92522
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

@ -1,19 +1,16 @@
<ion-view>
<ion-nav-bar class="bar-royal">
<ion-nav-buttons side="primary">
<button class="button button-clear" ui-sref="tabs.home">
Close
</button>
</ion-nav-buttons>
<ion-nav-back-button>
</ion-nav-back-button>
<ion-nav-title>BitPay Card</ion-nav-title>
<ion-nav-buttons side="secondary">
<button class="button button-clear" ui-sref="bitpayCard.preferences">
<i class="icon ion-gear-b"></i>
<button class="button back-button">
<i class="icon ion-ios-search-strong"></i>
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-content ng-controller="bitpayCardController as bitpayCard" ng-init="bitpayCard.init()">
<ion-content>
<div class="box-notification warning" ng-show="network == 'testnet'">
Sandbox version. Only for testing purpose

View File

@ -76,7 +76,7 @@
</p>
<i class="icon nav-item-arrow-right"></i>
</a>
<a ui-sref="bitpayCard.main"
<a ui-sref="tabs.bitpayCard"
ng-if="externalServices.BitpayCard"
class="item item-icon-left item-big-icon-left item-icon-right">
<i class="icon big-icon-svg">

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

View File

@ -150,10 +150,10 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
*
*/
.state('tabs.details', {
url: '/details/{walletId}/{fromOnboarding}',
.state('tabs.wallet', {
url: '/wallet/{walletId}/{fromOnboarding}',
views: {
'tab-home': {
'tab-home@tabs': {
controller: 'walletDetailsController',
templateUrl: 'views/walletDetails.html'
}
@ -166,7 +166,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.activity', {
url: '/activity',
views: {
'tab-home': {
'tab-home@tabs': {
controller: 'activityController',
templateUrl: 'views/activity.html',
}
@ -175,7 +175,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
.state('tabs.proposals', {
url: '/proposals',
views: {
'tab-home': {
'tab-home@tabs': {
controller: 'proposalsController',
templateUrl: 'views/proposals.html',
}
@ -836,29 +836,26 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
})
/*
*
* BitPay Card
*
*/
/*
*
* BitPay Card
*
*/
.state('bitpayCard', {
url: '/bitpayCard',
abstract: true,
template: '<ion-nav-view name="bitpayCard"></ion-nav-view>'
})
.state('bitpayCard.main', {
url: '/main',
.state('tabs.bitpayCard', {
url: '/bitpay-card',
views: {
'bitpayCard': {
'tab-home@tabs': {
controller: 'bitpayCardController',
controllerAs: 'bitpayCard',
templateUrl: 'views/bitpayCard.html'
}
}
})
.state('bitpayCard.preferences', {
.state('tabs.bitpayCard.preferences', {
url: '/preferences',
views: {
'bitpayCard': {
'tab-home@tabs': {
templateUrl: 'views/preferencesBitpayCard.html'
}
}

View File

@ -833,7 +833,7 @@ angular.module('copayApp.services')
x.action = function() {
// TODO?
// $state.go('tabs.details', {
// $state.go('tabs.wallet', {
// walletId: x.walletId,
// txpId: x.txpId,
// txid: x.txid,