fix enabled services

This commit is contained in:
JDonadio 2017-01-19 13:16:29 -03:00
commit c3f2230f33
4 changed files with 31 additions and 9 deletions

View file

@ -24,9 +24,9 @@ angular.module('copayApp.controllers').controller('advancedSettingsController',
$scope.recentTransactionsEnabled = { $scope.recentTransactionsEnabled = {
value: config.recentTransactions.enabled value: config.recentTransactions.enabled
}; };
$scope.frequentlyUsedEnabled = { // $scope.frequentlyUsedEnabled = {
value: config.frequentlyUsed.enabled // value: config.frequentlyUsed.enabled
}; // };
}; };
$scope.spendUnconfirmedChange = function() { $scope.spendUnconfirmedChange = function() {

View file

@ -0,0 +1,19 @@
'use strict';
angular.module('copayApp.controllers').controller('buyandsellController', function($scope, $ionicHistory, $state, configService) {
$scope.$on("$ionicView.beforeEnter", function(event, data) {
configService.whenAvailable(function(config) {
$scope.isCoinbaseEnabled = config.coinbase.enabled;
$scope.isGlideraEnabled = config.glidera.enabled;
if (!$scope.isCoinbaseEnabled && !$scope.isGlideraEnabled)
goHome();
});
});
function goHome() {
$ionicHistory.removeBackView();
$state.go('tabs.home');
};
});

View file

@ -866,6 +866,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
url: '/buyandsell', url: '/buyandsell',
views: { views: {
'tab-home': { 'tab-home': {
controller: 'buyandsellController',
templateUrl: 'views/buyandsell.html' templateUrl: 'views/buyandsell.html'
} }
} }

View file

@ -5,15 +5,17 @@
<ion-nav-title translate>Buy and sell</ion-nav-title> <ion-nav-title translate>Buy and sell</ion-nav-title>
</ion-nav-bar> </ion-nav-bar>
<ion-content> <ion-content>
<ion-list> <div class="list">
<ion-item class="item item-icon-right" ui-sref="tabs.buyandsell.coinbase"> <div class="item item-divider"></div>
<div class="item item-icon-right" ui-sref="tabs.buyandsell.coinbase" ng-show="isCoinbaseEnabled">
<img src="img/coinbase-logo.png" width="90"> <img src="img/coinbase-logo.png" width="90">
<i class="icon bp-arrow-right"></i> <i class="icon bp-arrow-right"></i>
</ion-item> </div>
<ion-item class="item item-icon-right" ui-sref="tabs.buyandsell.glidera"> <div class="item item-icon-right" ui-sref="tabs.buyandsell.glidera" ng-show="isGlideraEnabled">
<img src="img/glidera-logo.png" width="90"> <img src="img/glidera-logo.png" width="90">
<i class="icon bp-arrow-right"></i> <i class="icon bp-arrow-right"></i>
</ion-item> </div>
</ion-list> </div>
</ion-content> </ion-content>
</ion-view> </ion-view>