Disables BitPay Card from appConfig

This commit is contained in:
Gustavo Maximiliano Cortez 2017-03-02 09:53:54 -03:00
commit f13d9ca6a4
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
2 changed files with 7 additions and 1 deletions

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.services').factory('bitpayCardService', function($log, $rootScope, $filter, lodash, storageService, bitauthService, platformInfo, moment, appIdentityService, bitpayService, nextStepsService, configService, txFormatService) { angular.module('copayApp.services').factory('bitpayCardService', function($log, $rootScope, $filter, lodash, storageService, bitauthService, platformInfo, moment, appIdentityService, bitpayService, nextStepsService, configService, txFormatService, appConfigService) {
var root = {}; var root = {};
var _setError = function(msg, e) { var _setError = function(msg, e) {
@ -1323,6 +1323,8 @@ angular.module('copayApp.services').factory('bitpayCardService', function($log,
root.registerNextStep = function() { root.registerNextStep = function() {
// Disable BitPay Card
if (!appConfigService._enabledExtensions.debitcard) return;
root.getCards(function(err, cards) { root.getCards(function(err, cards) {
if (lodash.isEmpty(cards)) { if (lodash.isEmpty(cards)) {
nextStepsService.register(nextStepItem); nextStepsService.register(nextStepItem);

View file

@ -165,6 +165,10 @@ angular.module('copayApp.services').factory('incomingData', function($log, $stat
// BitPayCard Authentication // BitPayCard Authentication
} else if (data && data.indexOf(appConfigService.name + '://') === 0) { } else if (data && data.indexOf(appConfigService.name + '://') === 0) {
// Disable BitPay Card
if (!appConfigService._enabledExtensions.debitcard) return false;
var secret = getParameterByName('secret', data); var secret = getParameterByName('secret', data);
var email = getParameterByName('email', data); var email = getParameterByName('email', data);
var otp = getParameterByName('otp', data); var otp = getParameterByName('otp', data);